mirror of
https://github.com/fluencelabs/redis
synced 2025-04-01 23:31:03 +00:00
in rdbLoadDoubleValue now the buffer is nul terminated correctly. Thanks valgrind.
This commit is contained in:
parent
83c6a61889
commit
231d758eec
1
redis.c
1
redis.c
@ -2823,6 +2823,7 @@ static int rdbLoadDoubleValue(FILE *fp, double *val) {
|
|||||||
case 253: *val = R_Nan; return 0;
|
case 253: *val = R_Nan; return 0;
|
||||||
default:
|
default:
|
||||||
if (fread(buf,len,1,fp) == 0) return -1;
|
if (fread(buf,len,1,fp) == 0) return -1;
|
||||||
|
buf[len] = '\0';
|
||||||
sscanf(buf, "%lg", val);
|
sscanf(buf, "%lg", val);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user