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

Fix memory safety issues #260

Merged
merged 10 commits into from
Jan 6, 2022
Prev Previous commit
Next Next commit
ucl_check_variable: fix out_len on unterminated variable
If the input contains '${' but no following '}', ucl_check_variable
should still increment out_len since ucl_expand_variable will copy the
'$' in the destination buffer.

Fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=24591
  • Loading branch information
alpire committed Jan 4, 2022
commit 3a94514709b7d0d3420f96549172059bfaac2b65
3 changes: 3 additions & 0 deletions src/ucl_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,9 @@ ucl_check_variable (struct ucl_parser *parser, const char *ptr,
}
p ++;
}
if(p == end) {
(*out_len) ++;
}
}
else if (*ptr != '$') {
/* Not count escaped dollar sign */
Expand Down