aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-08-15 21:41:31 +0200
committerDavid Robillard <d@drobilla.net>2020-08-16 13:56:40 +0200
commit6a9db19eb786b51cf1aea232ae7af72b35ac834a (patch)
tree3070cabe6671c13932d923f3ff3a1c81171f885b /tests
parent9a847982aa7d4c5f77f89b5d289835b9fb174c5e (diff)
downloadserd-6a9db19eb786b51cf1aea232ae7af72b35ac834a.tar.gz
serd-6a9db19eb786b51cf1aea232ae7af72b35ac834a.tar.bz2
serd-6a9db19eb786b51cf1aea232ae7af72b35ac834a.zip
Fix EOF and null byte handling
This is a bit questionable, but the null byte support is needed for streaming over a socket where some delimiter is required. This caused a bug where serdi would hang forever on corrupt files that contain a null byte. Fix this by consuming the byte, but otherwise behaving as before.
Diffstat (limited to 'tests')
-rw-r--r--tests/bad/bad-null-byte.ttlbin0 -> 27 bytes
-rw-r--r--tests/bad/manifest.ttl6
2 files changed, 6 insertions, 0 deletions
diff --git a/tests/bad/bad-null-byte.ttl b/tests/bad/bad-null-byte.ttl
new file mode 100644
index 00000000..4f2cb404
--- /dev/null
+++ b/tests/bad/bad-null-byte.ttl
Binary files differ
diff --git a/tests/bad/manifest.ttl b/tests/bad/manifest.ttl
index 57fb02f7..2c103a84 100644
--- a/tests/bad/manifest.ttl
+++ b/tests/bad/manifest.ttl
@@ -59,6 +59,7 @@
<#bad-misspelled-prefix>
<#bad-namespace>
<#bad-ns>
+ <#bad-null-byte>
<#bad-num>
<#bad-object2>
<#bad-object>
@@ -337,6 +338,11 @@
mf:name "bad-ns" ;
mf:action <bad-ns.ttl> .
+<#bad-null-byte>
+ rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "bad-null-byte" ;
+ mf:action <bad-null-byte.ttl> .
+
<#bad-num>
rdf:type rdft:TestTurtleNegativeSyntax ;
mf:name "bad-num" ;