aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/reader.c4
-rw-r--r--tests/bad-list.ttl1
2 files changed, 3 insertions, 2 deletions
diff --git a/src/reader.c b/src/reader.c
index fb539819..04891658 100644
--- a/src/reader.c
+++ b/src/reader.c
@@ -1030,7 +1030,7 @@ inline static bool
is_object_end(const uint8_t c)
{
switch (c) {
- case 0x9: case 0xA: case 0xD: case 0x20:
+ case 0x9: case 0xA: case 0xD: case 0x20: case '\0':
case '#': case '.': case ';':
return true;
default:
@@ -1053,6 +1053,7 @@ read_object(SerdReader reader, ReadContext ctx)
Node o = INTERNAL_NODE_NULL;
const uint8_t c = peek_byte(reader);
switch (c) {
+ case '\0':
case ')':
return false;
case '[': case '(':
@@ -1205,7 +1206,6 @@ read_collection(SerdReader reader, ReadContext ctx, Node* dest)
ctx.subject = dest;
ctx.predicate = &reader->rdf_first;
if (!read_object(reader, ctx)) {
- pop_string(reader, dest->value);
return error(reader, "unexpected end of collection\n");
}
diff --git a/tests/bad-list.ttl b/tests/bad-list.ttl
new file mode 100644
index 00000000..60e21351
--- /dev/null
+++ b/tests/bad-list.ttl
@@ -0,0 +1 @@
+<> <http://example.org/pred> ( \ No newline at end of file