Skip to content

Commit

Permalink
Check url whether is NULL in parse_url
Browse files Browse the repository at this point in the history
Signed-off-by: Jianhui Zhao <jianhuizhao329@gmail.com>
  • Loading branch information
Jianhui Zhao committed Apr 27, 2019
1 parent 9d4d6b6 commit 0a838be
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ int parse_url(const char *url, char *host, int host_len,
const char *host_pos;
int hl = 0;

if (!url)
return -1;

if (!strncmp(url, "ws://", 5)) {
*ssl = false;
url += 5;
Expand Down

0 comments on commit 0a838be

Please sign in to comment.