Skip to content

Commit

Permalink
fix for #167 (#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
pbiering authored and aneesh-n committed Feb 14, 2023
1 parent e1aaca5 commit 24eb511
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions common-src/amutil.c
Original file line number Diff line number Diff line change
@@ -1132,6 +1132,12 @@ char *hexdecode_string(const char *str, GError **err)
new_len = orig_len = strlen(str);
for (i = 0; i < orig_len; i++) {
if (str[i] == '%') {
if (new_len < 2) {
g_set_error(err, am_util_error_quark(), AM_UTIL_ERROR_HEXDECODEINVAL,
"Invalid hexcode string: %s", str);
s = g_string_sized_new(0);
goto cleanup;
}
new_len -= 2;
}
}

0 comments on commit 24eb511

Please sign in to comment.