aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-03-10 16:21:36 +0100
committerDavid Robillard <d@drobilla.net>2021-03-08 23:23:05 -0500
commit5b319b320879618d316031a60ef9836fcf70deb2 (patch)
tree4c4a8b2b19bc9cc3e79879c0cf39af565dae611c
parenta3c9577b876c5255c877fe42f12fd01fee5676a9 (diff)
downloadserd-5b319b320879618d316031a60ef9836fcf70deb2.tar.gz
serd-5b319b320879618d316031a60ef9836fcf70deb2.tar.bz2
serd-5b319b320879618d316031a60ef9836fcf70deb2.zip
Strengthen writer statement preconditions
-rw-r--r--src/writer.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/writer.c b/src/writer.c
index 867b5020..0930a187 100644
--- a/src/writer.c
+++ b/src/writer.c
@@ -858,7 +858,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;
}