Fix possible crash having just upgraded from 1.6.

Happens if `per_listener_settings true` is set, and a SIGHUP is sent to
the broker before a client has reconnected to the broker.

Closes #2167. Thanks to momoskitto.
This commit is contained in:
Roger Light 2021-04-08 22:49:11 +01:00
parent ec54bce037
commit c418b57d0f
2 changed files with 8 additions and 0 deletions

View File

@ -1,6 +1,11 @@
2.0.11 - 2021-xx-xx
===================
Broker:
- Fix possible crash having just upgraded from 1.6 if `per_listener_settings
true` is set, and a SIGHUP is sent to the broker before a client has
reconnected to the broker. Closes #2167.
Clients:
- If sending mosquitto_sub output to a pipe, mosquitto_sub will now detect
that the pipe has closed and disconnect. Closes #2164.

View File

@ -764,6 +764,9 @@ int mosquitto_unpwd_check(struct mosquitto *context)
rc = MOSQ_ERR_PLUGIN_DEFER;
if(db.config->per_listener_settings){
if(context->listener == NULL){
return MOSQ_ERR_AUTH;
}
opts = &context->listener->security_options;
}else{
opts = &db.config->security_options;