summaryrefslogtreecommitdiff
path: root/tests/integration/corrupt-dump.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'tests/integration/corrupt-dump.tcl')
-rw-r--r--tests/integration/corrupt-dump.tcl19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/integration/corrupt-dump.tcl b/tests/integration/corrupt-dump.tcl
index ef878457a..35dca23be 100644
--- a/tests/integration/corrupt-dump.tcl
+++ b/tests/integration/corrupt-dump.tcl
@@ -810,5 +810,24 @@ test {corrupt payload: fuzzer findings - empty set listpack} {
}
}
+test {corrupt payload: fuzzer findings - set with duplicate elements causes sdiff to hang} {
+ start_server [list overrides [list loglevel verbose use-exit-on-panic yes crash-memcheck-enabled no] ] {
+ r config set sanitize-dump-payload yes
+ r debug set-skip-checksum-validation 1
+ catch {r restore _key 0 "\x14\x25\x25\x00\x00\x00\x0A\x00\x06\x01\x82\x5F\x35\x03\x04\x01\x82\x5F\x31\x03\x82\x5F\x33\x03\x00\x01\x82\x5F\x39\x03\x82\x5F\x33\x03\x08\x01\x02\x01\xFF\x0B\x00\x31\xBE\x7D\x41\x01\x03\x5B\xEC" replace} err
+ assert_match "*Bad data format*" $err
+ r ping
+
+ # In the past, it generated a broken protocol and left the client hung in sdiff
+ r config set sanitize-dump-payload no
+ assert_equal {OK} [r restore _key 0 "\x14\x25\x25\x00\x00\x00\x0A\x00\x06\x01\x82\x5F\x35\x03\x04\x01\x82\x5F\x31\x03\x82\x5F\x33\x03\x00\x01\x82\x5F\x39\x03\x82\x5F\x33\x03\x08\x01\x02\x01\xFF\x0B\x00\x31\xBE\x7D\x41\x01\x03\x5B\xEC" replace]
+ assert_type set _key
+ assert_encoding listpack _key
+ assert_equal 10 [r scard _key]
+ assert_equal {0 2 4 6 8 _1 _3 _3 _5 _9} [lsort [r smembers _key]]
+ assert_equal {0 2 4 6 8 _1 _3 _5 _9} [lsort [r sdiff _key]]
+ }
+}
+
} ;# tags