Skip to content

Commit

Permalink
Merge pull request #1268 from tillz/fix_client_nullptr
Browse files Browse the repository at this point in the history
Fixed Segmentation Fault / NULLptr dereference
  • Loading branch information
ralight committed May 10, 2019
2 parents cd3877e + 8518d08 commit c411b73
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 c411b73

Please sign in to comment.