diff options
author | Gary E. Miller <gem@rellim.com> | 2018-06-14 19:01:18 -0700 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2018-06-14 19:01:18 -0700 |
commit | 317375877576b10fd5312a7b0dec4a192881eead (patch) | |
tree | 8c0dffd99fa55d5e60e8bcb6a568dd08119c0365 /json.c | |
parent | 8c746a1a1d72031df001031377112841c1bc199c (diff) | |
download | gpsd-317375877576b10fd5312a7b0dec4a192881eead.tar.gz |
json.c be sure a string is NUL terminated.
Diffstat (limited to 'json.c')
-rw-r--r-- | json.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -394,6 +394,7 @@ static int json_internal_read_object(const char *cp, case 'u': for (n = 0; n < 4 && cp[n] != '\0'; n++) uescape[n] = *cp++; + uescape[n] = '\0'; /* terminate */ --cp; (void)sscanf(uescape, "%04x", &u); *pval++ = (char)u; /* will truncate values above 0xff */ |