Permalink
Browse files

Crash fix for @prefix

(start_element): Do not crash if strtok_r returns NULL during walk
through @prefix.  Instead, abort attribute prefix search

This makes RDFA 1.0 test 0209 work for me
  • Loading branch information...
1 parent 5d705b4 commit f8c8abd53c59236d18d4ff5ade0a51d7ec828ba6 @dajobe dajobe committed May 16, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 c/rdfa.c
View
@@ -522,6 +522,9 @@ static void start_element(void *parser_context, const char* name,
saveptr++;
}
iri = strtok_r(NULL, RDFA_WHITESPACE, &saveptr);
+ if(!saveptr)
+ break;
+
while((*saveptr == ' ' || *saveptr == '\n' ||
*saveptr == '\r' || *saveptr == '\t' || *saveptr == '\f' ||
*saveptr == '\v') && *saveptr != '\0')

0 comments on commit f8c8abd

Please sign in to comment.