mirror of
https://github.com/fluencelabs/redis
synced 2025-03-18 08:30:51 +00:00
fixed possible buffer overflow error
This commit is contained in:
parent
658ad301cc
commit
433e835d3e
@ -398,7 +398,7 @@ int rdbSaveDoubleValue(rio *rdb, double val) {
|
||||
double min = -4503599627370495; /* (2^52)-1 */
|
||||
double max = 4503599627370496; /* -(2^52) */
|
||||
if (val > min && val < max && val == ((double)((long long)val)))
|
||||
ll2string((char*)buf+1,sizeof(buf),(long long)val);
|
||||
ll2string((char*)buf+1,sizeof(buf)-1,(long long)val);
|
||||
else
|
||||
#endif
|
||||
snprintf((char*)buf+1,sizeof(buf)-1,"%.17g",val);
|
||||
|
Loading…
x
Reference in New Issue
Block a user