Fixes a crash in SPARQL unicode escapes decoding

pull/190/head
Tpt 3 years ago
parent f6c54e4b1f
commit 8fec549b85
  1. 4
      lib/spargebra/src/parser.rs
  2. 1
      testsuite/oxigraph-tests/sparql/long_unicode_escape_with_multibytes_char.rq
  3. 1
      testsuite/oxigraph-tests/sparql/long_unicode_escape_with_multibytes_char.ru
  4. 20
      testsuite/oxigraph-tests/sparql/manifest.ttl
  5. 1
      testsuite/oxigraph-tests/sparql/small_unicode_escape_with_multibytes_char.rq
  6. 1
      testsuite/oxigraph-tests/sparql/small_unicode_escape_with_multibytes_char.ru

@ -731,7 +731,7 @@ impl<'a> Iterator for UnescapeUnicodeCharIterator<'a> {
return Some('\\');
}
}
if let Some(c) = u32::from_str_radix(&self.buffer[1..5], 16)
if let Some(c) = u32::from_str_radix(&self.buffer[1..], 16)
.ok()
.and_then(char::from_u32)
{
@ -750,7 +750,7 @@ impl<'a> Iterator for UnescapeUnicodeCharIterator<'a> {
return Some('\\');
}
}
if let Some(c) = u32::from_str_radix(&self.buffer[1..9], 16)
if let Some(c) = u32::from_str_radix(&self.buffer[1..], 16)
.ok()
.and_then(char::from_u32)
{

@ -9,6 +9,10 @@
rdfs:label "Oxigraph SPARQL tests" ;
mf:entries
(
:small_unicode_escape_with_multibytes_char
:long_unicode_escape_with_multibytes_char
:small_unicode_escape_with_multibytes_char_update
:long_unicode_escape_with_multibytes_char_update
:describe
:describe_where
:group_concat_with_null
@ -21,6 +25,22 @@
:update_dirtyRead
) .
:small_unicode_escape_with_multibytes_char rdf:type mf:NegativeSyntaxTest ;
mf:name "Multibytes character at the end of a unicode espace sequence" ;
mf:action <small_unicode_escape_with_multibytes_char.rq> .
:long_unicode_escape_with_multibytes_char rdf:type mf:NegativeSyntaxTest ;
mf:name "Multibytes character at the end of a unicode espace sequence" ;
mf:action <long_unicode_escape_with_multibytes_char.rq> .
:small_unicode_escape_with_multibytes_char_update rdf:type mf:NegativeUpdateSyntaxTest11 ;
mf:name "Multibytes character at the end of a unicode espace sequence" ;
mf:action <small_unicode_escape_with_multibytes_char.ru> .
:long_unicode_escape_with_multibytes_char_update rdf:type mf:NegativeUpdateSyntaxTest11 ;
mf:name "Multibytes character at the end of a unicode espace sequence" ;
mf:action <long_unicode_escape_with_multibytes_char.ru> .
:describe rdf:type mf:QueryEvaluationTest ;
mf:name "Simple DESCRIBE request" ;
mf:action

Loading…
Cancel
Save