diff options
author | zhangtaoXT5 <50564994+zhangtaoXT5@users.noreply.github.com> | 2022-09-02 04:45:28 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-01 13:45:28 -0700 |
commit | bc8d837b72aa226ac1b0c4e112ad08ed8da6d0d3 (patch) | |
tree | a87aa4e8d15ad75cc1f1c82259390719df497307 | |
parent | ca4a0e850b9978104980ce980997f7a351376994 (diff) |
fix heap-buffer-overflow (#957)
Prevent incrementing passed a `\0` in our format string.
Co-authored-by: Michael Grunder <michael.grunder@gmail.com>
Co-authored-by: Kristján Valur Jónsson <sweskman@gmail.com>
-rw-r--r-- | hiredis.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -485,6 +485,8 @@ int redisvFormatCommand(char **target, const char *format, va_list ap) { touched = 1; c++; + if (*c == '\0') + break; } c++; } |