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
This commit is contained in:
Bob Li 2021-01-12 14:22:53 +08:00 committed by GitHub
parent fe2fdef7b0
commit 542455ce2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;