From 9464e3fe190818bf6e0ae9dcb56a9020b1f303f7 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Tue, 20 Nov 2018 10:15:34 +0000 Subject: [PATCH] Guard against possible null client id. --- src/persist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/persist.c b/src/persist.c index b83327c3..3299356d 100644 --- a/src/persist.c +++ b/src/persist.c @@ -287,7 +287,7 @@ static int persist__subs_retain_write(struct mosquitto_db *db, FILE *db_fptr, st sub = node->subs; while(sub){ - if(sub->context->clean_session == false){ + if(sub->context->clean_session == false && sub->context->id){ length = htonl(2+strlen(sub->context->id) + 2+strlen(thistopic) + sizeof(uint8_t)); i16temp = htons(DB_CHUNK_SUB);