From 1898cb086af03460e73b388cbe715a16bba9987e Mon Sep 17 00:00:00 2001 From: zhengshuxin Date: Sat, 9 Jul 2022 17:46:38 +0800 Subject: [PATCH] fixed one bug in redis_command::run() if request_buf_ is NULL. --- Makefile | 2 +- lib_acl/src/init/acl_init.c | 2 +- lib_acl_cpp/samples/redis/redis_pubsub/valgrind.sh | 0 lib_acl_cpp/src/redis/redis_command.cpp | 6 ++++++ packaging/acl-libs.spec | 7 ++++++- 5 files changed, 14 insertions(+), 3 deletions(-) mode change 100644 => 100755 lib_acl_cpp/samples/redis/redis_pubsub/valgrind.sh diff --git a/Makefile b/Makefile index d7ea0a4b1..ebc210c39 100644 --- a/Makefile +++ b/Makefile @@ -82,7 +82,7 @@ endif ############################################################################## .PHONY = check help all_lib all samples all clean install uninstall uninstall_all build_one -VERSION = 3.5.3-14 +VERSION = 3.5.3-15 default: build_one acl_master help h: diff --git a/lib_acl/src/init/acl_init.c b/lib_acl/src/init/acl_init.c index b038921e9..5c0791cff 100644 --- a/lib_acl/src/init/acl_init.c +++ b/lib_acl/src/init/acl_init.c @@ -25,7 +25,7 @@ #include "init.h" -static char *version = "3.5.3-14 20220615-15:00"; +static char *version = "3.5.3-15 20220709-17:38"; const char *acl_version(void) { diff --git a/lib_acl_cpp/samples/redis/redis_pubsub/valgrind.sh b/lib_acl_cpp/samples/redis/redis_pubsub/valgrind.sh old mode 100644 new mode 100755 diff --git a/lib_acl_cpp/src/redis/redis_command.cpp b/lib_acl_cpp/src/redis/redis_command.cpp index 3cbe62e9d..f5fc68f77 100644 --- a/lib_acl_cpp/src/redis/redis_command.cpp +++ b/lib_acl_cpp/src/redis/redis_command.cpp @@ -387,8 +387,14 @@ const redis_result* redis_command::run(size_t nchild /* = 0 */, conn_->set_check_addr(check_addr_); if (slice_req_) { + if (request_obj_ == NULL) { + request_obj_ = NEW redis_request(); + } result_ = conn_->run(dbuf_, *request_obj_, nchild, timeout); } else { + if (request_buf_ == NULL) { + request_buf_ = NEW string(128); + } result_ = conn_->run(dbuf_, *request_buf_, nchild, timeout); } return result_; diff --git a/packaging/acl-libs.spec b/packaging/acl-libs.spec index 2a59a37b9..314c928db 100644 --- a/packaging/acl-libs.spec +++ b/packaging/acl-libs.spec @@ -1,4 +1,4 @@ -%define release_id 14 +%define release_id 15 Summary: The powerful c/c++ library Name: acl-libs @@ -47,6 +47,11 @@ rm -rf %{buildroot} %changelog +* Sat Jul 09 2022 shuxin.zheng shuxin.zheng@qq.com 3.5.3-15-20220709.17 +- bugfix: fixed one crash bug that redis_command::request_buf_ will be NULL + when calling redis_pubsub::get_message() first without calling + redis_pubsub::subscribe() before. + * Wed Jun 15 2022 shuxin.zheng shuxin.zheng@qq.com 3.5.3-14-20220615.15 - bugfix: fixed one bug in redis_client_pipeline.cpp about handling redirect message.