From bb8f19e9e4fbcfa015f48377df34cb89e5b1173e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 15 Mar 2016 18:02:32 -0400 Subject: Fix potential out of bounds read --- src/writer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/writer.c') diff --git a/src/writer.c b/src/writer.c index 59080592..a037bf81 100644 --- a/src/writer.c +++ b/src/writer.c @@ -522,7 +522,8 @@ write_node(SerdWriter* writer, !strcmp(type_uri + sizeof(NS_XSD) - 1, "integer"))) { sink(node->buf, node->n_bytes, writer); break; - } else if (!strcmp(type_uri + sizeof(NS_XSD) - 1, "decimal") && + } else if (!strncmp(type_uri, NS_XSD, sizeof(NS_XSD) - 1) && + !strcmp(type_uri + sizeof(NS_XSD) - 1, "decimal") && strchr((const char*)node->buf, '.') && node->buf[node->n_bytes - 1] != '.') { /* xsd:decimal literals without trailing digits, e.g. "5.", can -- cgit v1.2.1