diff options
author | Oran Agra <oran@redislabs.com> | 2020-11-02 09:35:37 +0200 |
---|---|---|
committer | Oran Agra <oran@redislabs.com> | 2020-12-06 14:54:34 +0200 |
commit | 3716950cfc389c0f7ed13fac5bd205173c2d8189 (patch) | |
tree | 7e9e73ac7ffda406e85a19c1b365a1a13deab81d /src/ziplist.h | |
parent | 5b44631397787a65327fcab77f7df37862286ed9 (diff) | |
download | redis-3716950cfc389c0f7ed13fac5bd205173c2d8189.tar.gz |
Sanitize dump payload: validate no duplicate records in hash/zset/intset
If RESTORE passes successfully with full sanitization, we can't affort
to crash later on assertion due to duplicate records in a hash when
converting it form ziplist to dict.
This means that when doing full sanitization, we must make sure there
are no duplicate records in any of the collections.
Diffstat (limited to 'src/ziplist.h')
-rw-r--r-- | src/ziplist.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ziplist.h b/src/ziplist.h index 8d1ac1691..5153951dc 100644 --- a/src/ziplist.h +++ b/src/ziplist.h @@ -49,7 +49,9 @@ unsigned char *ziplistFind(unsigned char *zl, unsigned char *p, unsigned char *v unsigned int ziplistLen(unsigned char *zl); size_t ziplistBlobLen(unsigned char *zl); void ziplistRepr(unsigned char *zl); -int ziplistValidateIntegrity(unsigned char *zl, size_t size, int deep); +typedef int (*ziplistValidateEntryCB)(unsigned char* p, void* userdata); +int ziplistValidateIntegrity(unsigned char *zl, size_t size, int deep, + ziplistValidateEntryCB entry_cb, void *cb_userdata); #ifdef REDIS_TEST int ziplistTest(int argc, char *argv[]); |