more test
authorBen Pfaff <blp@cs.stanford.edu>
Sun, 6 Jul 2025 20:00:31 +0000 (13:00 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Sun, 6 Jul 2025 20:00:31 +0000 (13:00 -0700)
rust/pspp/src/sys/test.rs
rust/pspp/src/sys/testdata/invalid_variable_name.expected
rust/pspp/src/sys/testdata/multiple_documents_records.expected
rust/pspp/src/sys/testdata/null_dereference_skipping_bad_extension_record_18.expected
rust/pspp/src/sys/testdata/null_dereference_skipping_bad_extension_record_18.sack [deleted file]
rust/pspp/src/sys/testdata/null_dereference_skipping_bad_extension_record_18.sav [new file with mode: 0644]

index 255a30539a564f044bab0768cd7558faf2efd716..075c0384ece9db73b88b03ecb4d8c331ebe9a2cf 100644 (file)
@@ -507,9 +507,14 @@ fn integer_overflows_in_long_string_missing_values() {
     test_raw_sysfile("integer_overflows_in_long_string_missing_values");
 }
 
+/// CVE-2017-10792.
+/// See also https://bugzilla.redhat.com/show_bug.cgi?id=1467005.
+/// See also https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=866890.
+/// See also https://security-tracker.debian.org/tracker/CVE-2017-10792.
+/// Reported by team OWL337, with fuzzer collAFL.
 #[test]
 fn null_dereference_skipping_bad_extension_record_18() {
-    test_sack_sysfile("null_dereference_skipping_bad_extension_record_18");
+    test_raw_sysfile("null_dereference_skipping_bad_extension_record_18");
 }
 
 /// Duplicate variable name handling negative test.
index 49475a8d647081aaec6244239eecc8bc2b253068..9ac792f6ba37e5e4091a9cde2472bf63a36595b8 100644 (file)
@@ -1,8 +1,8 @@
-"$UM1" may not be used as an identifier because it begins with disallowed character "$".  Renaming variable to VAR001.
+"$UM1" may not be used as an identifier because it begins with disallowed character '$'.  Renaming variable to VAR001.
 
-"#UM1" may not be used as an identifier because it begins with disallowed character "#".  Renaming variable to VAR002.
+"#UM1" may not be used as an identifier because it begins with disallowed character '#'.  Renaming variable to VAR002.
 
-"!UM1" may not be used as an identifier because it begins with disallowed character "!".  Renaming variable to VAR003.
+"!UM1" may not be used as an identifier because it begins with disallowed character '!'.  Renaming variable to VAR003.
 
 "GE" may not be used as an identifier because it is a reserved word.  Renaming variable to VAR004.
 
index 634c52ca578f61e5543cca2052167781fc95aaee..414d01908c1c7c72b3ec6f9ced8e51c67f0865e9 100644 (file)
@@ -3,7 +3,7 @@
 ├──────────────────────┼────────────────────────┤
 │Writer Product        │PSPP synthetic test file│
 ├──────────────────────┼────────────────────────┤
-│       Compression    │SAV                     │
+│       Compression    │None                    │
 │       Number of Cases│Unknown                 │
 ╰──────────────────────┴────────────────────────╯
 
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..950b17e8b60353e2e983bcfcd27bebb05d8f128f 100644 (file)
@@ -0,0 +1,51 @@
+At offset 0x1c8, variable attributes record has bad size 4 bytes instead of the expected 1.
+
+This system file does not indicate its own character encoding.  For best results, specify an encoding explicitly.  Use SYSFILE INFO with ENCODING="DETECT" to analyze the possible encodings.
+
+╭──────────────────────┬────────────────────────────────────╮
+│       Created        │                30-JAN-2013 14:34:58│
+├──────────────────────┼────────────────────────────────────┤
+│Writer Product        │MS Windows Release 12.0 spssio32.dll│
+├──────────────────────┼────────────────────────────────────┤
+│       Compression    │SAV                                 │
+│       Number of Cases│                                  10│
+╰──────────────────────┴────────────────────────────────────╯
+
+╭─────────┬─╮
+│Variables│4│
+╰─────────┴─╯
+
+╭────────┬────────┬─────┬─────────────────┬─────┬─────┬─────────┬────────────┬────────────┬──────────────╮
+│        │Position│Label│Measurement Level│ Role│Width│Alignment│Print Format│Write Format│Missing Values│
+├────────┼────────┼─────┼─────────────────┼─────┼─────┼─────────┼────────────┼────────────┼──────────────┤
+│VAR00001│       1│     │Scale            │Input│    8│Right    │F8.2        │F8.2        │              │
+│VAR00002│       2│     │Nominal          │Input│    8│Right    │F8.2        │F8.2        │              │
+│VAR00003│       3│     │Scale            │Input│    8│Right    │F8.2        │F8.2        │              │
+│VAR00004│       4│     │Nominal          │Input│    8│Left     │A1          │A1          │              │
+╰────────┴────────┴─────┴─────────────────┴─────┴─────┴─────────┴────────────┴────────────┴──────────────╯
+
+╭───────────────────┬──────────╮
+│Variable Value     │          │
+├───────────────────┼──────────┤
+│VAR00002       1.00│Male      │
+│               2.00│Female    │
+├───────────────────┼──────────┤
+│VAR00003       2.00│Student   │
+│               3.00│Employed  │
+│               4.00│Unemployed│
+╰───────────────────┴──────────╯
+
+╭────┬────────┬────────┬────────┬────────╮
+│Case│VAR00001│VAR00002│VAR00003│VAR00004│
+├────┼────────┼────────┼────────┼────────┤
+│1   │    1.00│    1.00│    2.00│a       │
+│2   │    2.00│    2.00│    3.00│s       │
+│3   │    3.00│    1.00│    4.00│d       │
+│4   │    4.00│    2.00│    3.00│f       │
+│5   │    5.00│    1.00│    4.00│g       │
+│6   │    6.00│    2.00│    2.00│h       │
+│7   │    7.00│    1.00│    4.00│j       │
+│8   │    8.00│    2.00│    3.00│k       │
+│9   │    9.00│    1.00│    2.00│l       │
+│10  │   10.00│    2.00│    4.00│p       │
+╰────┴────────┴────────┴────────┴────────╯
diff --git a/rust/pspp/src/sys/testdata/null_dereference_skipping_bad_extension_record_18.sack b/rust/pspp/src/sys/testdata/null_dereference_skipping_bad_extension_record_18.sack
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/rust/pspp/src/sys/testdata/null_dereference_skipping_bad_extension_record_18.sav b/rust/pspp/src/sys/testdata/null_dereference_skipping_bad_extension_record_18.sav
new file mode 100644 (file)
index 0000000..e36df43
Binary files /dev/null and b/rust/pspp/src/sys/testdata/null_dereference_skipping_bad_extension_record_18.sav differ