From 542455ce2afbaffc065afbfdf6578399b8faecda Mon Sep 17 00:00:00 2001 From: Bob Li <342974971@qq.com> Date: Tue, 12 Jan 2021 14:22:53 +0800 Subject: [PATCH] Fix overflow of rdbWriteRaw return value (#8306) Saving string of more than 2GB to the RDB file, can result in corrupt RDB, or failure in rdbSave. S --- src/rdb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rdb.c b/src/rdb.c index 25e900689..7deed2a2d 100644 --- a/src/rdb.c +++ b/src/rdb.c @@ -94,7 +94,7 @@ void rdbReportError(int corruption_error, int linenum, char *reason, ...) { exit(1); } -static int rdbWriteRaw(rio *rdb, void *p, size_t len) { +static ssize_t rdbWriteRaw(rio *rdb, void *p, size_t len) { if (rdb && rioWrite(rdb,p,len) == 0) return -1; return len;