Prevent NULL derefencing and accessing of freed memory.

pull/211/merge
Roger A. Light 11 years ago
parent 3d58f5ed82
commit 2bf7a8fb13

@ -481,6 +481,7 @@ int mqtt3_handle_connect(struct mosquitto_db *db, struct mosquitto *context)
found_context->ws_context = context->ws_context;
found_context->sock = WEBSOCKET_CLIENT;
context->wsi = NULL;
context->ws_context = NULL;
context->sock = INVALID_SOCKET;
/* This is a hack to allow us to update the wsi->user_space

@ -97,7 +97,7 @@ static int _subs_process(struct mosquitto_db *db, struct _mosquitto_subhier *hie
}
}
while(source_id && leaf){
if(leaf->context->is_bridge && !strcmp(leaf->context->id, source_id)){
if(!leaf->context->id || (leaf->context->is_bridge && !strcmp(leaf->context->id, source_id))){
leaf = leaf->next;
continue;
}

Loading…
Cancel
Save