]> git.saurik.com Git - redis.git/commitdiff
in rdbLoadDoubleValue now the buffer is nul terminated correctly. Thanks valgrind.
authorantirez <antirez@gmail.com>
Sun, 6 Dec 2009 00:42:41 +0000 (01:42 +0100)
committerantirez <antirez@gmail.com>
Sun, 6 Dec 2009 00:42:41 +0000 (01:42 +0100)
redis.c

diff --git a/redis.c b/redis.c
index 2ea511f5f3def77a3f9788ddd4d39557a6819842..302a2129d660101c61e425703c31faa2a4cc0499 100644 (file)
--- 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;
     }