Commit b78ac354 authored by antirez's avatar antirez
Browse files

redis-check-aof: fix potential overflow.

Bug signaled by @vattezhang in PR #5940 but fixed differently.
parent 8ea906a3
...@@ -33,8 +33,8 @@ ...@@ -33,8 +33,8 @@
#define ERROR(...) { \ #define ERROR(...) { \
char __buf[1024]; \ char __buf[1024]; \
sprintf(__buf, __VA_ARGS__); \ snprintf(__buf, sizeof(__buf), __VA_ARGS__); \
sprintf(error, "0x%16llx: %s", (long long)epos, __buf); \ snprintf(error, sizeof(error), "0x%16llx: %s", (long long)epos, __buf); \
} }
static char error[1024]; static char error[1024];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment