diff options
author | David Robillard <d@drobilla.net> | 2020-02-25 19:57:36 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-10-27 13:13:59 +0100 |
commit | f7368a5920ce3e8897d4fa716dcc1023abfad19c (patch) | |
tree | a7b369f1d301d30465bdce36e64da08e80154802 /src | |
parent | 641158b887c02bfda17702c6ff6c2dba4e53f466 (diff) | |
download | serd-f7368a5920ce3e8897d4fa716dcc1023abfad19c.tar.gz serd-f7368a5920ce3e8897d4fa716dcc1023abfad19c.tar.bz2 serd-f7368a5920ce3e8897d4fa716dcc1023abfad19c.zip |
Emit reader errors on stack overflows in string literals
Diffstat (limited to 'src')
-rw-r--r-- | src/n3.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -340,7 +340,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 @@ -378,6 +382,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; } |