aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordefault <nobody@localhost>2025-02-05 11:04:28 +0100
committerdefault <nobody@localhost>2025-02-05 11:04:28 +0100
commitbec483653384e22c989f6a08921a5617284e5e7e (patch)
treefc413ca4a96a69422e28c0ab74f5d69828aa6969
parent3318f1596bbb2853a8305194204084b32790fbd7 (diff)
Fixed JSON string parsing.
-rw-r--r--xs_json.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/xs_json.h b/xs_json.h
index 660c277..d1b18e4 100644
--- a/xs_json.h
+++ b/xs_json.h
@@ -280,6 +280,12 @@ static xs_val *_xs_json_load_lexer(FILE *f, js_type *t)
else {
char cc = c;
v = xs_insert_m(v, offset, &cc, 1);
+
+ if (!xs_is_string(v)) {
+ *t = JS_ERROR;
+ break;
+ }
+
offset++;
}
}