From 8f2afa4e97563af18ec323d7f8aeaeeff1483782 Mon Sep 17 00:00:00 2001 From: Lev Brouk Date: Thu, 16 Nov 2023 01:30:08 -0800 Subject: [PATCH] [FIXED] SEGFAULT in js_Subscribe if consumer Name is NULL --- src/js.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/js.c b/src/js.c index 2dc52d517..27910cb0c 100644 --- a/src/js.c +++ b/src/js.c @@ -2656,7 +2656,10 @@ _subscribe(natsSubscription **new_sub, jsCtx *js, const char *subject, const cha // set only if jsi->consumer is NULL! if (jsi->consumer == NULL) { - DUP_STRING(s, jsi->consumer, info->Name); + if (info->Name != NULL) + { + DUP_STRING(s, jsi->consumer, info->Name); + } if (s == NATS_OK) { NATS_FREE(jsi->nxtMsgSubj);