summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/jplist.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/jplist.c b/src/jplist.c
index cb29742..ace4bff 100644
--- a/src/jplist.c
+++ b/src/jplist.c
@@ -496,13 +496,13 @@ static char* unescape_string(const char* str_val, size_t str_len, size_t *new_le
496 case 'u': { 496 case 'u': {
497 unsigned int val = 0; 497 unsigned int val = 0;
498 if (str_len-(i+2) < 4) { 498 if (str_len-(i+2) < 4) {
499 free(strval);
500 PLIST_JSON_ERR("%s: invalid escape sequence '%s' (too short)\n", __func__, strval+i); 499 PLIST_JSON_ERR("%s: invalid escape sequence '%s' (too short)\n", __func__, strval+i);
500 free(strval);
501 return NULL; 501 return NULL;
502 } 502 }
503 if (!(isxdigit(strval[i+2]) && isxdigit(strval[i+3]) && isxdigit(strval[i+4]) && isxdigit(strval[i+5])) || sscanf(strval+i+2, "%04x", &val) != 1) { 503 if (!(isxdigit(strval[i+2]) && isxdigit(strval[i+3]) && isxdigit(strval[i+4]) && isxdigit(strval[i+5])) || sscanf(strval+i+2, "%04x", &val) != 1) {
504 free(strval);
505 PLIST_JSON_ERR("%s: invalid escape sequence '%.*s'\n", __func__, 6, strval+i); 504 PLIST_JSON_ERR("%s: invalid escape sequence '%.*s'\n", __func__, 6, strval+i);
505 free(strval);
506 return NULL; 506 return NULL;
507 } 507 }
508 int bytelen = 0; 508 int bytelen = 0;