Skip to content

fix: keep alive host data in uws_app_listen_with_config #212#227

Open
goteguru wants to merge 1 commit intocirospaciari:mainfrom
goteguru:main
Open

fix: keep alive host data in uws_app_listen_with_config #212#227
goteguru wants to merge 1 commit intocirospaciari:mainfrom
goteguru:main

Conversation

@goteguru
Copy link
Copy Markdown

Description

This PR fixes #212

Minimal change to keep alive char[] for host data in listen() call.
uws_app_listen_config_t struct has a host field which is a char* pointer, therefore we create a string (ffi.new("char[]", host)) if necessary. Later we save the uws_app_listen_config_t ffi struct to self.native_options_listen in order to keep it alive, what is correct, but we don't save the string. The pointer doesn't own the string, it might be freed and overwritten by garbage.

This trivial patch fixes that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Listening host string is not sent to uws properly

1 participant