-
-
Notifications
You must be signed in to change notification settings - Fork 481
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
Fixed handling of long strings when using INI_USE_STACK #148
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -156,6 +156,14 @@ int ini_parse_stream(ini_reader reader, void* stream, ini_handler handler, | |
|
||
lineno++; | ||
|
||
#if INI_USE_STACK | ||
if (strlen(line) == max_line - 1 && line[max_line - 2] != '\n') { | ||
/* Exit even if INI_STOP_ON_FIRST_ERROR is not set */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I'm not sure about this. If You can see how it's breaking the existing max-line tests as it is currently. |
||
error = lineno; | ||
break; | ||
} | ||
#endif | ||
|
||
start = line; | ||
#if INI_ALLOW_BOM | ||
if (lineno == 1 && (unsigned char)start[0] == 0xEF && | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should do this check whether or not
INI_USE_STACK
is set, right? Because even in non-stack mode we might have read and realloc'd up toINI_MAX_LINE
bytes.