Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

segfault: gethostbyname(), double free with invalid destination addresses #26

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

msantos
Copy link

@msantos msantos commented Dec 11, 2018

No description provided.

Calling into the resolver causes a segfault:

~~~
LD_PRELOAD=./libglb.so GLB_OPTIONS="--random 1234 x" ls
Segmentation fault (core dumped)
~~~

For libglb, bypass the resolver and parse the IPv4 address.
If parsing the destination list from the environment fails, the pointer
to the configuration may be freed twice: by glb_parse_dst_list() and
glb_env_parse():

~~~
$ LD_PRELOAD=./src/.libs/libglb.so GLB_OPTIONS="--random 1234 x" ls
LIBGLB:   ERROR: glb_dst.c:86: Invalid argument
Invalid destination spec: x
*** Error in `nc': double free or corruption (!prev): 0x0091c008 ***
Aborted (core dumped)
~~~

Check the return value from env_parse_options()/glb_parse_dst_list() was
not NULL before attempting to free().
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.

1 participant