Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 044b303

Browse files
bentleyomichael-grunder
authored andcommitted
Reduce buffer size for signed integer, strlen(-9223372036854775808) = 20 + 1 for '\0'
1 parent 35c5988 commit 044b303

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,7 @@ int redis_cmd_append_sstr_long(smart_string *str, long append) {
10601060
* Append a 64-bit integer to our command
10611061
*/
10621062
int redis_cmd_append_sstr_i64(smart_string *str, int64_t append) {
1063-
char nbuf[64];
1063+
char nbuf[21];
10641064
int len = snprintf(nbuf, sizeof(nbuf), "%" PRId64, append);
10651065
return redis_cmd_append_sstr(str, nbuf, len);
10661066
}

0 commit comments

Comments
 (0)