Fix crash when loading invalid persistence file.

Closes oss-fuzz #474389119. Regression in unreleased code.
This commit is contained in:
Roger A. Light
2026-01-09 22:15:34 +00:00
parent ae7cf71dcf
commit 428308e2cb

View File

@@ -163,6 +163,10 @@ int persist__chunk_base_msg_read_v234(FILE *db_fptr, struct P_base_msg *chunk, u
if(rc){
goto error;
}
if(!chunk->topic){
rc = MOSQ_ERR_INVAL;
goto error;
}
slen = strlen(chunk->topic);
if(slen > UINT16_MAX){
rc = MOSQ_ERR_INVAL;