Skip to content

Commit

Permalink
Make corrupt-dump-fuzzer support HFE
Browse files Browse the repository at this point in the history
  • Loading branch information
sundb committed May 16, 2024
1 parent 237d19c commit 17b544f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/integration/corrupt-dump-fuzzer.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ proc generate_collections {suffix elements} {
# add both string values and integers
if {$j % 2 == 0} {set val $j} else {set val "_$j"}
$rd hset hash$suffix $j $val
$rd hset hashmd$suffix $j $val
$rd hexpire hashmd$suffix [expr {int(rand() * 10000)}] 1 $j
$rd lpush list$suffix $val
$rd zadd zset$suffix $j $val
$rd sadd set$suffix $val
$rd xadd stream$suffix * item 1 value $val
}
for {set j 0} {$j < $elements * 5} {incr j} {
for {set j 0} {$j < $elements * 7} {incr j} {
$rd read ; # Discard replies
}
$rd close
Expand Down
9 changes: 9 additions & 0 deletions tests/integration/corrupt-dump.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ test {corrupt payload: valid zipped hash header, dup records} {
}
}

test {corrupt payload: hash listpackex with invalid string TTL} {
start_server [list overrides [list loglevel verbose use-exit-on-panic yes crash-memcheck-enabled no] ] {
r config set sanitize-dump-payload yes
catch {r restore key 0 "\x17--\x00\x00\x00\t\x00\x81a\x02\x01\x01\xf4\xa6\x96\x18\xb8\x8f\x01\x00\x00\t\x82f1\x03\x82v1\x03\x83foo\x04\x82f2\x03\x82v2\x03\x00\x01\xff\x0c\x00\xde@\xe57Q\x1c\x12V" replace} err
assert_match "*Bad data format*" $err
r ping
}
}

test {corrupt payload: quicklist big ziplist prev len} {
start_server [list overrides [list loglevel verbose use-exit-on-panic yes crash-memcheck-enabled no] ] {
r config set sanitize-dump-payload no
Expand Down

0 comments on commit 17b544f

Please sign in to comment.