redis-check-aof: fix potential overflow.

Bug signaled by @vattezhang in PR #5940 but fixed differently.
This commit is contained in:
antirez 2019-03-18 11:15:39 +01:00
parent 8ea906a3e8
commit b78ac354f4

View File

@ -33,8 +33,8 @@
#define ERROR(...) { \
char __buf[1024]; \
sprintf(__buf, __VA_ARGS__); \
sprintf(error, "0x%16llx: %s", (long long)epos, __buf); \
snprintf(__buf, sizeof(__buf), __VA_ARGS__); \
snprintf(error, sizeof(error), "0x%16llx: %s", (long long)epos, __buf); \
}
static char error[1024];