From: Arran Cudbard-Bell Date: Sat, 29 Jul 2023 15:42:02 +0000 (-0400) Subject: redisGetReply doesn't nullify the reply pointer when there's no reply... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1c29295675aa6e8ebee3ddd61572829a6653acff;p=thirdparty%2Ffreeradius-server.git redisGetReply doesn't nullify the reply pointer when there's no reply... --- diff --git a/src/modules/rlm_redis/rlm_redis.c b/src/modules/rlm_redis/rlm_redis.c index dea448cfcca..2cd540b1c6e 100644 --- a/src/modules/rlm_redis/rlm_redis.c +++ b/src/modules/rlm_redis/rlm_redis.c @@ -207,7 +207,8 @@ parse_reply: /* * Process the response for the command */ - if (redisGetReply(conn->handle, (void **)&reply) == REDIS_OK) maybe_more = true; + reply = NULL; /* Doesn't set reply to NULL on error *sigh* */ + if ((redisGetReply(conn->handle, (void **)&reply) == REDIS_OK) && read_only) maybe_more = true; status = fr_redis_command_status(conn, reply); if (status != REDIS_RCODE_SUCCESS) { *reply_out = reply; @@ -229,6 +230,7 @@ parse_reply: /* * Process the response for READWRITE */ + reply = NULL; /* Doesn't set reply to NULL on error *sigh* */ if ((redisGetReply(conn->handle, (void **)&reply) != REDIS_OK) || (fr_redis_command_status(conn, reply) != REDIS_RCODE_SUCCESS)) { ROPTIONAL(REDEBUG, ERROR, "Setting READWRITE failed");