Skip to content
New issue

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

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

Already on GitHub? # to your account

Prevent segfault with parsing certain content in seigrc #7

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

Prevent segfault with parsing certain content in seigrc #7

wants to merge 2 commits into from

Conversation

technion
Copy link

I've been running some instrumentation to try and identify the memory issue we've been discussing. With AddressSanitizer running, I'm seeing a crash with this backtrace:
#0 0x00007f49ad3f6bb4 in __msan_warning_noreturn ()
#1 0x00007f49ad477f6b in load_conf (filename=) at init.c:263
#2 0x00007f49ad4741b4 in init_config () at init.c:95
#3 0x00007f49ad47edf2 in main (argc=6, argv=0x7ffc75b85e38) at main.c:324

The problem with enumerating a string based on spaces is that if a line ends with a space, the next piece of code involves unallocated memory. Unfortunately, line 399 of the default .siegerc, contains a line ending in a space.

This PR prevents the use of unallocated memory in this scenario.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant