mirror of
https://github.com/eclipse-mosquitto/mosquitto.git
synced 2026-04-11 04:12:16 +02:00
Fix crash when loading invalid persistence file.
Closes oss-fuzz #474389119. Regression in unreleased code.
This commit is contained in:
parent
ae7cf71dcf
commit
428308e2cb
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue