diff options
author | David Robillard <d@drobilla.net> | 2022-11-24 16:40:46 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-11-24 16:40:46 -0500 |
commit | 055735f696138614d51e92f1152bb02f0cfbefe0 (patch) | |
tree | 291370b16775ba7b94bc3bebf58f8fe7f6719a45 /src | |
parent | 4846ad5212db89b9e72abee8da69ba87de65b113 (diff) | |
download | serd-055735f696138614d51e92f1152bb02f0cfbefe0.tar.gz serd-055735f696138614d51e92f1152bb02f0cfbefe0.tar.bz2 serd-055735f696138614d51e92f1152bb02f0cfbefe0.zip |
Gracefully handle bad characters in Turtle datatype syntax
Diffstat (limited to 'src')
-rw-r--r-- | src/n3.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -943,12 +943,15 @@ read_literal(SerdReader* const reader, break; case '^': eat_byte_safe(reader, '^'); - eat_byte_check(reader, '^'); + if (!eat_byte_check(reader, '^')) { + return r_err(reader, SERD_ERR_BAD_SYNTAX, "expected `^'\n"); + } + if ((st = read_iri(reader, datatype, ate_dot))) { *datatype = pop_node(reader, *datatype); *lang = pop_node(reader, *lang); *dest = pop_node(reader, *dest); - return r_err(reader, st, "bad literal\n"); + return r_err(reader, st, "bad datatype\n"); } break; } |