aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-02-25 19:57:36 +0100
committerDavid Robillard <d@drobilla.net>2021-03-08 23:23:06 -0500
commit01485668012c55f8d405266ad9208a9bc915a523 (patch)
treebd2417384e58527b0f983bdd4b406927a3ec8d28
parent1307128c0a6b5cffeecfb66db0ca1763d381e782 (diff)
downloadserd-01485668012c55f8d405266ad9208a9bc915a523.tar.gz
serd-01485668012c55f8d405266ad9208a9bc915a523.tar.bz2
serd-01485668012c55f8d405266ad9208a9bc915a523.zip
Emit reader errors on stack overflows in string literals
-rw-r--r--src/n3.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/n3.c b/src/n3.c
index f3811d18..a91a8367 100644
--- a/src/n3.c
+++ b/src/n3.c
@@ -357,7 +357,11 @@ read_STRING_LITERAL_LONG(SerdReader* reader, SerdNode* ref, uint8_t q)
}
}
- return (st && reader->strict) ? st : SERD_SUCCESS;
+ if (st && reader->strict) {
+ r_err(reader, st, "failed to read literal (%s)\n", serd_strerror(st));
+ }
+
+ return (st && reader->strict) ? SERD_ERR_BAD_SYNTAX : st;
}
// STRING_LITERAL_QUOTE and STRING_LITERAL_SINGLE_QUOTE
@@ -393,6 +397,10 @@ read_STRING_LITERAL(SerdReader* reader, SerdNode* ref, uint8_t q)
}
}
+ if (st && reader->strict) {
+ r_err(reader, st, "failed to read literal (%s)\n", serd_strerror(st));
+ }
+
return st;
}