diff options
author | Oran Agra <oran@redislabs.com> | 2021-07-01 08:19:04 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-01 08:19:04 +0300 |
commit | de9bae21efa2e14d71bdedb3326abacbb310135c (patch) | |
tree | 3d3813442953f3abb42af5cfe7b5d96fdb842609 /src/sds.c | |
parent | 16e04ed9442ed31ab2ec01035047e8118c7511a5 (diff) | |
download | redis-de9bae21efa2e14d71bdedb3326abacbb310135c.tar.gz |
Fix bug in sdscatfmt when % is the last format char (#9173)
For the sdscatfmt function in sds.c, when the parameter fmt ended up with '%',
the behavior is undefined. This commit fix this bug.
Co-authored-by: stafuc <stafuc@gmail.com>
Diffstat (limited to 'src/sds.c')
-rw-r--r-- | src/sds.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -682,6 +682,7 @@ sds sdscatfmt(sds s, char const *fmt, ...) { switch(*f) { case '%': next = *(f+1); + if (next == '\0') break; f++; switch(next) { case 's': |