Skip to content

nemo-main-application.c: Fix the open options split - #3899

Open
dualfroz wants to merge 1 commit into
linuxmint:masterfrom
dualfroz:fix/3628-open-options-strsplit
Open

dualfroz wants to merge 1 commit into
linuxmint:masterfrom
dualfroz:fix/3628-open-options-strsplit

Conversation

@dualfroz

Copy link
Copy Markdown
Contributor

nemo_main_application_open passed &splitter (a single char, no terminator) to g_strsplit, so the delimiter was whatever was on the stack after it, and when the split failed sscanf got a NULL split_options[1], which is the crash in the backtrace. it now splits on "=" and checks split_options[1] first. closes #3628

g_strsplit() got the address of a single char as its delimiter, so
strlen() read past it into the stack and the split depended on whatever
bytes followed. When it didn't split, split_options[1] was NULL and the
sscanf() on it crashed. Pass a real "=" string and only read the tabs
flag when it is there.
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.

Suspected unterminated/malformed C-string/gchar * in nemo_main_application_open()?

1 participant