Skip to content

Commit

Permalink
bugfix: OOB access in esc_low_ascii1
Browse files Browse the repository at this point in the history
add a missing check for negative char type values
  • Loading branch information
bbonev committed Aug 1, 2021
1 parent f27ce07 commit 8aaa4fc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ inline const char *esc_low_ascii1(char c) {
static char ehex[0x20][6];
static int initialized=0;

if (c>=0x20) // no escaping needed
if (c<0||c>=0x20) // no escaping needed
return NULL;
if (!initialized) {
int i;
Expand Down

0 comments on commit 8aaa4fc

Please sign in to comment.