From 52d0ac81eee3462c6839c7374ffe57329f7702b7 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 13 May 2018 00:48:31 +0200 Subject: Zero node padding before passing to reader sinks --- src/n3.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/n3.c') diff --git a/src/n3.c b/src/n3.c index 35e80fd5..3c45b718 100644 --- a/src/n3.c +++ b/src/n3.c @@ -1050,10 +1050,10 @@ read_object(SerdReader* reader, ReadContext* ctx, bool emit, bool* ate_dot) o->flags = flags; } - if (ret && emit && simple) { + if (ret && emit && simple && o) { ret = emit_statement(reader, *ctx, o); } else if (ret && !emit) { - ctx->object = o; + ctx->object = o; return true; } @@ -1261,6 +1261,7 @@ read_base(SerdReader* reader, bool sparql, bool token) if (!uri) { return false; } else if (reader->sink->base) { + serd_node_zero_pad(uri); reader->sink->base(reader->sink->handle, uri); } @@ -1295,12 +1296,14 @@ read_prefixID(SerdReader* reader, bool sparql, bool token) } read_ws_star(reader); - const SerdNode* uri = read_IRIREF(reader); + SerdNode* uri = read_IRIREF(reader); if (!uri) { return false; } if (reader->sink->prefix) { + serd_node_zero_pad(name); + serd_node_zero_pad(uri); ret = !reader->sink->prefix(reader->sink->handle, name, uri); } if (!sparql) { -- cgit v1.2.1