mirror of
https://github.com/eclipse-mosquitto/mosquitto.git
synced 2026-02-06 02:52:07 +08:00
Fix crash when loading invalid persistence file.
Closes oss-fuzz #474389119. Regression in unreleased code.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user