Commit 0aa08363 authored by Federico G. Schwindt's avatar Federico G. Schwindt

Use strncmp to avoid potential overruns

parent 8b9770ee
......@@ -373,15 +373,15 @@ vjsn_value(struct vjsn *js)
AN(jsv->value);
return (jsv);
}
if (!memcmp(js->ptr, "true", 4)) {
if (!strncmp(js->ptr, "true", 4)) {
js->ptr += 4;
return (vjsn_val_new(VJSN_TRUE));
}
if (!memcmp(js->ptr, "false", 5)) {
if (!strncmp(js->ptr, "false", 5)) {
js->ptr += 5;
return (vjsn_val_new(VJSN_FALSE));
}
if (!memcmp(js->ptr, "null", 4)) {
if (!strncmp(js->ptr, "null", 4)) {
js->ptr += 4;
return (vjsn_val_new(VJSN_NULL));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment