summaryrefslogtreecommitdiff
path: root/src/ntriples_parse.c
diff options
context:
space:
mode:
authorDave Beckett <dave@dajobe.org>2013-09-15 20:53:50 -0700
committerDave Beckett <dave@dajobe.org>2013-09-15 20:53:50 -0700
commit9ae4552a720cda695631869d3ba5e21326cd209e (patch)
tree82a453df906a6856acd58b08abfe814df4734dd0 /src/ntriples_parse.c
parent5204741ee82b932e30590400dec163112542059a (diff)
downloadraptor-9ae4552a720cda695631869d3ba5e21326cd209e.tar.gz
Check for 3 terms with N-Triples
Diffstat (limited to 'src/ntriples_parse.c')
-rw-r--r--src/ntriples_parse.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ntriples_parse.c b/src/ntriples_parse.c
index c853a90a..1c2ec1e6 100644
--- a/src/ntriples_parse.c
+++ b/src/ntriples_parse.c
@@ -493,7 +493,7 @@ raptor_ntriples_parse_line(raptor_parser* rdf_parser,
/* Must be triple/quad */
- for(i = 0; i < max_terms; i++) {
+ for(i = 0; i < 4; i++) {
if(!len) {
/* context is optional in nquads */
if (i == 3)
@@ -796,11 +796,13 @@ raptor_ntriples_parse_line(raptor_parser* rdf_parser,
}
- /* Just to be sure */
+ /* Check N-Triples has only 3 terms */
if(!ntriples_parser->is_nquads) {
if(real_terms[3]) {
raptor_free_term(real_terms[3]);
real_terms[3] = NULL;
+ raptor_parser_error(rdf_parser, "N-Triples only allows 3 terms");
+ goto cleanup;
}
}