Skip to content

Commit

Permalink
Fixed Segmentation Fault / NULLptr dereference
Browse files Browse the repository at this point in the history
Signed-off-by: Till Zimmermann <[email protected]>
  • Loading branch information
tillz authored and ralight committed Sep 17, 2019
1 parent d61c111 commit 863c0ee
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions client/client_shared.c
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,10 @@ int client_config_line_proc(struct mosq_config *cfg, int pub_or_sub, int argc, c
return 1;
}
topic = strchr(url, '/');
if(!topic){
fprintf(stderr, "Error: invalid URL for -L argument specified.\n\n");
return 1;
}
*topic++ = 0;

if(cfg_add_topic(cfg, pub_or_sub, topic, "-L topic"))
Expand Down

0 comments on commit 863c0ee

Please sign in to comment.