]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Strings need to be copied to the to_cast box first
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 2 Dec 2021 15:19:19 +0000 (09:19 -0600)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 2 Dec 2021 15:30:56 +0000 (09:30 -0600)
src/lib/redis/redis.c

index 377a5ed1d6f72aa0ace498e15fb22f902b16be01..76881a8224396b29f3e22d15a3e8cb517e3d7d10 100644 (file)
@@ -278,9 +278,9 @@ int fr_redis_reply_to_value_box(TALLOC_CTX *ctx, fr_value_box_t *out, redisReply
        case REDIS_REPLY_STRING:
        case REDIS_REPLY_STATUS:
                if (shallow) {
-                       fr_value_box_bstrndup_shallow(out, NULL, reply->str, reply->len, true);
+                       fr_value_box_bstrndup_shallow(to_cast, NULL, reply->str, reply->len, true);
                } else {
-                       if (fr_value_box_bstrndup(ctx, out, NULL, reply->str, reply->len, true) < 0) return -1;
+                       if (fr_value_box_bstrndup(ctx, to_cast, NULL, reply->str, reply->len, true) < 0) return -1;
                }
                break;