aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS5
-rw-r--r--src/reader.c6
-rw-r--r--tests/bad/bad-dot-after-subject.ttl1
-rw-r--r--tests/bad/bad-semicolon-after-subject.ttl1
-rw-r--r--wscript2
5 files changed, 10 insertions, 5 deletions
diff --git a/NEWS b/NEWS
index 18b516f6..6947032d 100644
--- a/NEWS
+++ b/NEWS
@@ -1,8 +1,9 @@
-serd (0.29.1) unstable;
+serd (0.29.2) unstable;
* Support strict parsing of prefixed names
+ * Report errors for prematurely terminated statements
- -- David Robillard <d@drobilla.net> Sun, 30 Jul 2017 10:35:24 +0200
+ -- David Robillard <d@drobilla.net> Mon, 28 Aug 2017 12:39:47 +0200
serd (0.28.0) stable;
diff --git a/src/reader.c b/src/reader.c
index b224979b..f1b445b9 100644
--- a/src/reader.c
+++ b/src/reader.c
@@ -1599,7 +1599,7 @@ read_statement(SerdReader* reader)
ReadContext ctx = { 0, 0, 0, 0, 0, 0, &flags };
Ref subj = 0;
bool ate_dot = false;
- char s_type = false;
+ char s_type = 0;
bool ret = true;
read_ws_star(reader);
switch (peek_byte(reader)) {
@@ -1641,7 +1641,9 @@ read_statement(SerdReader* reader)
} else if (!subj) {
ret = r_err(reader, SERD_ERR_BAD_SYNTAX, "bad subject\n");
} else if (!read_triples(reader, ctx, &ate_dot)) {
- ret = (s_type == '[');
+ if (!(ret = (s_type == '['))) {
+ r_err(reader, SERD_ERR_BAD_SYNTAX, "expected predicate\n");
+ }
} else if (!ate_dot) {
read_ws_star(reader);
ret = (eat_byte_check(reader, '.') == '.');
diff --git a/tests/bad/bad-dot-after-subject.ttl b/tests/bad/bad-dot-after-subject.ttl
new file mode 100644
index 00000000..e76e0ea2
--- /dev/null
+++ b/tests/bad/bad-dot-after-subject.ttl
@@ -0,0 +1 @@
+<http://example.org/s> . <http://example.org/p> <http://example.org/o> .
diff --git a/tests/bad/bad-semicolon-after-subject.ttl b/tests/bad/bad-semicolon-after-subject.ttl
new file mode 100644
index 00000000..582c6ea0
--- /dev/null
+++ b/tests/bad/bad-semicolon-after-subject.ttl
@@ -0,0 +1 @@
+<http://example.org/s> ; <http://example.org/p> <http://example.org/o> .
diff --git a/wscript b/wscript
index eaf6d50e..c080b05e 100644
--- a/wscript
+++ b/wscript
@@ -11,7 +11,7 @@ import waflib.extras.autowaf as autowaf
# major increment <=> incompatible changes
# minor increment <=> compatible changes (additions)
# micro increment <=> no interface changes
-SERD_VERSION = '0.29.1'
+SERD_VERSION = '0.29.2'
SERD_MAJOR_VERSION = '0'
# Mandatory waf variables