summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/t_stream.c3
-rw-r--r--tests/integration/corrupt-dump-fuzzer.tcl1
-rw-r--r--tests/integration/rdb.tcl1
3 files changed, 4 insertions, 1 deletions
diff --git a/src/t_stream.c b/src/t_stream.c
index 4a425fd78..18138bec5 100644
--- a/src/t_stream.c
+++ b/src/t_stream.c
@@ -3570,7 +3570,7 @@ int streamValidateListpackIntegrity(unsigned char *lp, size_t size, int deep) {
p = next; if (!lpValidateNext(lp, &next, size)) return 0;
/* deleted */
- lpGetIntegerIfValid(p, &valid_record);
+ int64_t deleted_count = lpGetIntegerIfValid(p, &valid_record);
if (!valid_record) return 0;
p = next; if (!lpValidateNext(lp, &next, size)) return 0;
@@ -3589,6 +3589,7 @@ int streamValidateListpackIntegrity(unsigned char *lp, size_t size, int deep) {
if (!valid_record || zero != 0) return 0;
p = next; if (!lpValidateNext(lp, &next, size)) return 0;
+ entry_count += deleted_count;
while (entry_count--) {
if (!p) return 0;
int64_t fields = master_fields, extra_fields = 3;
diff --git a/tests/integration/corrupt-dump-fuzzer.tcl b/tests/integration/corrupt-dump-fuzzer.tcl
index 2506205a5..4fb503b8e 100644
--- a/tests/integration/corrupt-dump-fuzzer.tcl
+++ b/tests/integration/corrupt-dump-fuzzer.tcl
@@ -32,6 +32,7 @@ proc generate_types {} {
# add some metadata to the stream
r xgroup create stream mygroup 0
set records [r xreadgroup GROUP mygroup Alice COUNT 2 STREAMS stream >]
+ r xdel stream [lindex [lindex [lindex [lindex $records 0] 1] 1] 0]
r xack stream mygroup [lindex [lindex [lindex [lindex $records 0] 1] 0] 0]
# create other non-collection types
diff --git a/tests/integration/rdb.tcl b/tests/integration/rdb.tcl
index 7df1e2f74..9e1c2651a 100644
--- a/tests/integration/rdb.tcl
+++ b/tests/integration/rdb.tcl
@@ -52,6 +52,7 @@ start_server [list overrides [list "dir" $server_path] keep_persistence true] {
}
r xgroup create stream mygroup 0
set records [r xreadgroup GROUP mygroup Alice COUNT 2 STREAMS stream >]
+ r xdel stream [lindex [lindex [lindex [lindex $records 0] 1] 1] 0]
r xack stream mygroup [lindex [lindex [lindex [lindex $records 0] 1] 0] 0]
set digest [r debug digest]
r config set sanitize-dump-payload no