From cbda492909cd2fff25263913cd2e1f00bc48a541 Mon Sep 17 00:00:00 2001 From: sundb Date: Mon, 9 Aug 2021 22:13:46 +0800 Subject: Sanitize dump payload: handle remaining empty key when RDB loading and restore command (#9349) This commit mainly fixes empty keys due to RDB loading and restore command, which was omitted in #9297. 1) When loading quicklsit, if all the ziplists in the quicklist are empty, NULL will be returned. If only some of the ziplists are empty, then we will skip the empty ziplists silently. 2) When loading hash zipmap, if zipmap is empty, sanitization check will fail. 3) When loading hash ziplist, if ziplist is empty, NULL will be returned. 4) Add RDB loading test with sanitize. --- tests/assets/corrupt_empty_keys.rdb | Bin 187 -> 261 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'tests/assets') diff --git a/tests/assets/corrupt_empty_keys.rdb b/tests/assets/corrupt_empty_keys.rdb index bc2b4f202..8f260d493 100644 Binary files a/tests/assets/corrupt_empty_keys.rdb and b/tests/assets/corrupt_empty_keys.rdb differ -- cgit v1.2.1