Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpredis/phpredis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormichael-grunder <michael.grunder@gmail.com>2020-06-26 18:36:30 +0300
committermichael-grunder <michael.grunder@gmail.com>2020-06-26 18:36:30 +0300
commit57bb95bf5a01a2adb74e2bf73bb285488e0d1586 (patch)
tree2aac3332f397ef5d197d7c82d3c9cd9d51758658 /library.c
parent262cc70e9e4adac13dc4956aef7374e7520fd5d2 (diff)
Also NULL terminate if format is NULL
Diffstat (limited to 'library.c')
-rw-r--r--library.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/library.c b/library.c
index 9b58c53d..e60f35a5 100644
--- a/library.c
+++ b/library.c
@@ -777,8 +777,10 @@ redis_pool_spprintf(RedisSock *redis_sock, char *fmt, ...) {
smart_str_append_long(&str, (zend_long)redis_sock->port);
/* Short circuit if we don't have a pattern */
- if (fmt == NULL)
+ if (fmt == NULL) {
+ smart_str_0(&str);
return str.s;
+ }
while (*fmt) {
switch (*fmt) {