From 8ea777a6a02cae22aeff95f054d810f30b7b69ad Mon Sep 17 00:00:00 2001 From: sundb Date: Fri, 6 Aug 2021 03:42:20 +0800 Subject: Sanitize dump payload: fix empty keys when RDB loading and restore command (#9297) When we load rdb or restore command, if we encounter a length of 0, it will result in the creation of an empty key. This could either be a corrupt payload, or a result of a bug (see #8453 ) This PR mainly fixes the following: 1) When restore command will return `Bad data format` error. 2) When loading RDB, we will silently discard the key. Co-authored-by: Oran Agra --- tests/assets/corrupt_empty_keys.rdb | Bin 0 -> 187 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 tests/assets/corrupt_empty_keys.rdb (limited to 'tests/assets') diff --git a/tests/assets/corrupt_empty_keys.rdb b/tests/assets/corrupt_empty_keys.rdb new file mode 100644 index 000000000..bc2b4f202 Binary files /dev/null and b/tests/assets/corrupt_empty_keys.rdb differ -- cgit v1.2.1