diff options
author | David Robillard <d@drobilla.net> | 2023-04-03 10:47:40 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-04-06 07:19:10 -0400 |
commit | 9910494d7bb417fb75f1c99b65f9956d14184059 (patch) | |
tree | 24d59725e7aaef0f1dd08e54367c531484773091 /src | |
parent | 0065bfadaa18c53b077ded4fbca09da65ed84017 (diff) | |
download | serd-9910494d7bb417fb75f1c99b65f9956d14184059.tar.gz serd-9910494d7bb417fb75f1c99b65f9956d14184059.tar.bz2 serd-9910494d7bb417fb75f1c99b65f9956d14184059.zip |
Gracefully handle boolean subject and predicate errors
Diffstat (limited to 'src')
-rw-r--r-- | src/n3.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -1644,6 +1644,9 @@ read_n3_statement(SerdReader* const reader) pop_node(reader, ctx.graph); ctx.graph = 0; read_ws_star(reader); + } else if (!tokcmp(reader, ctx.subject, "true", 4) || + !tokcmp(reader, ctx.subject, "false", 5)) { + return r_err(reader, SERD_ERR_BAD_SYNTAX, "expected subject\n"); } else if (read_ws_star(reader) && peek_byte(reader) == '{') { if (s_type == '(' || (s_type == '[' && !*ctx.flags)) { return r_err(reader, SERD_ERR_BAD_SYNTAX, "invalid graph name\n"); |