diff options
author | David Robillard <d@drobilla.net> | 2019-03-10 16:21:36 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-10-27 13:13:58 +0100 |
commit | 66386fd801be86a8df5ae1652390c5bf8ba3132d (patch) | |
tree | f39045e2a985d9a4c83d44315129b29ea112f342 /src | |
parent | b58e832527b850eca5e2c5a6f2157d307b0f45b5 (diff) | |
download | serd-66386fd801be86a8df5ae1652390c5bf8ba3132d.tar.gz serd-66386fd801be86a8df5ae1652390c5bf8ba3132d.tar.bz2 serd-66386fd801be86a8df5ae1652390c5bf8ba3132d.zip |
Strengthen writer statement preconditions
Diffstat (limited to 'src')
-rw-r--r-- | src/writer.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/writer.c b/src/writer.c index a12f39b9..09470b1a 100644 --- a/src/writer.c +++ b/src/writer.c @@ -758,7 +758,9 @@ serd_writer_write_statement(SerdWriter* writer, const SerdNode* const object = serd_statement_object(statement); const SerdNode* const graph = serd_statement_graph(statement); - if (!is_resource(subject) || !is_resource(predicate) || !object) { + if (!is_resource(subject) || !is_resource(predicate) || !object || + ((flags & SERD_ANON_S) && (flags & SERD_LIST_S)) || + ((flags & SERD_ANON_O) && (flags & SERD_LIST_O))) { return SERD_ERR_BAD_ARG; } |