mirror of
https://github.com/eclipse-mosquitto/mosquitto.git
synced 2026-09-21 23:47:52 +08:00
Fix assert failure when loading a persistence file.
If the file contains subscriptions with no client id.
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
2.0.19 - 2023-11-xx
|
||||
===================
|
||||
|
||||
Broker:
|
||||
- Fix assert failure when loading a persistence file that contains
|
||||
subscriptions with no client id.
|
||||
|
||||
|
||||
2.0.18 - 2023-09-18
|
||||
===================
|
||||
|
||||
|
||||
+8
-2
@@ -547,8 +547,14 @@ static int persist__restore_sub(const char *client_id, const char *sub, uint8_t
|
||||
{
|
||||
struct mosquitto *context;
|
||||
|
||||
assert(client_id);
|
||||
assert(sub);
|
||||
if(!client_id){
|
||||
log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Persistence found a subscription with no client id, ignoring.");
|
||||
return MOSQ_ERR_SUCCESS;
|
||||
}
|
||||
if(!sub){
|
||||
log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Persistence found a subscription with no topic filter, ignoring.");
|
||||
return MOSQ_ERR_SUCCESS;
|
||||
}
|
||||
|
||||
context = persist__find_or_add_context(client_id, 0);
|
||||
if(!context) return 1;
|
||||
|
||||
Reference in New Issue
Block a user