Skip to content

Commit

Permalink
Fixed SEGFAULT when parsing a CLF log format and using --ignore-crawl…
Browse files Browse the repository at this point in the history
…ers.
  • Loading branch information
allinurl committed Jul 22, 2014
1 parent 47f71b0 commit 3bf6d57
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions browsers.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,12 @@ int
is_crawler (const char *agent)
{
char type[BROWSER_TYPE_LEN];
char *browser, *a = xstrdup (agent);
if ((browser = verify_browser (a, type)) != NULL)
char *browser, *a;

if (agent == NULL || *agent == '\0')
return 0;

if ((a = xstrdup (agent), browser = verify_browser (a, type)) != NULL)
free (browser);
free (a);

Expand Down

0 comments on commit 3bf6d57

Please sign in to comment.