aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-03-10 16:21:36 +0100
committerDavid Robillard <d@drobilla.net>2019-12-20 10:26:55 -0500
commit50c08e1e15563193826500645b675d13ef744f3f (patch)
tree6a80d8d35abac8670aa7c021d6997949a40c4a4c
parent399d2f05fd4f6e9ee3fdc2f55af8cbd45aa1f4dd (diff)
downloadserd-50c08e1e15563193826500645b675d13ef744f3f.tar.gz
serd-50c08e1e15563193826500645b675d13ef744f3f.tar.bz2
serd-50c08e1e15563193826500645b675d13ef744f3f.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 cf8ae2fe..58224534 100644
--- a/src/writer.c
+++ b/src/writer.c
@@ -726,7 +726,9 @@ serd_writer_write_statement(SerdWriter* writer,
const SerdNode* const object = serd_statement_get_object(statement);
const SerdNode* const graph = serd_statement_get_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;
}