From 231d758eecf6e492c8b40cddf4bc9e3a4dbf39cb Mon Sep 17 00:00:00 2001 From: antirez Date: Sun, 6 Dec 2009 01:42:41 +0100 Subject: [PATCH] in rdbLoadDoubleValue now the buffer is nul terminated correctly. Thanks valgrind. --- redis.c | 1 + 1 file changed, 1 insertion(+) diff --git a/redis.c b/redis.c index 2ea511f5..302a2129 100644 --- a/redis.c +++ b/redis.c @@ -2823,6 +2823,7 @@ static int rdbLoadDoubleValue(FILE *fp, double *val) { case 253: *val = R_Nan; return 0; default: if (fread(buf,len,1,fp) == 0) return -1; + buf[len] = '\0'; sscanf(buf, "%lg", val); return 0; } -- GitLab