diff options
author | David Robillard <d@drobilla.net> | 2020-02-25 19:57:36 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2021-03-08 23:23:06 -0500 |
commit | 01485668012c55f8d405266ad9208a9bc915a523 (patch) | |
tree | bd2417384e58527b0f983bdd4b406927a3ec8d28 /src/n3.c | |
parent | 1307128c0a6b5cffeecfb66db0ca1763d381e782 (diff) | |
download | serd-01485668012c55f8d405266ad9208a9bc915a523.tar.gz serd-01485668012c55f8d405266ad9208a9bc915a523.tar.bz2 serd-01485668012c55f8d405266ad9208a9bc915a523.zip |
Emit reader errors on stack overflows in string literals
Diffstat (limited to 'src/n3.c')
-rw-r--r-- | src/n3.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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; } |