Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on a particular user agent "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:49.0) Gecko/20100101 Firefox/49.0" #5

Open
RobertSwirsky opened this issue Oct 26, 2016 · 0 comments

Comments

@RobertSwirsky
Copy link

Crash:

uaparser:parse(<<"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:49.0) Gecko/20100101 Firefox/49.0">>).                                                                                            
** exception error: bad argument
     in function  list_to_integer/1
        called as list_to_integer([])
     in call from uaparser_utils:bin_to_num/1 (src/uaparser_utils.erl, line 69)
     in call from uaparser_os:'-get_version_details/1-lc$^0/1-0-'/1 (src/uaparser_os.erl, line 37)
     in call from uaparser_os:'-get_version_details/1-lc$^0/1-0-'/1 (src/uaparser_os.erl, line 37)
     in call from uaparser_os:get_version/2 (src/uaparser_os.erl, line 30)
     in call from uaparser_os:make_proplist/2 (src/uaparser_os.erl, line 14)
     in call from uaparser:parse/1 (src/uaparser.erl, line 12)
(sideband@localhost)5> 
(sideband@localhost)5> uaparser:parse("Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:49.0) Gecko/20100101 Firefox/49.0").    ** exception error: bad argument                                                            
     in function  list_to_integer/1
        called as list_to_integer([])
     in call from uaparser_utils:bin_to_num/1 (src/uaparser_utils.erl, line 69)
     in call from uaparser_os:'-get_version_details/1-lc$^0/1-0-'/1 (src/uaparser_os.erl, line 37)
     in call from uaparser_os:'-get_version_details/1-lc$^0/1-0-'/1 (src/uaparser_os.erl, line 37)
     in call from uaparser_os:get_version/2 (src/uaparser_os.erl, line 30)
     in call from uaparser_os:make_proplist/2 (src/uaparser_os.erl, line 14)
     in call from uaparser:parse/1 (src/uaparser.erl, line 12)

The example on the readme.md works!

 uaparser:parse("Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/5.0; SLCC1; .NET CLR 2.0.50727; InfoPath.1; .NET CLR 3.5.30729; WinTSI 08.02.2010; .NET CLR 3.0.30729; .NET4.0C; BRI/1)").
[{browser,[{name,<<"internet explorer 7">>},
           {family,ie},
           {manufacturer,microsoft},
           {type,web_browser},
           {renderer,trident},
           {version,<<"7.0">>},
           {version_details,[{major,7},{minor,0}]}]},
 {os,[{name,<<"windows vista">>},
      {family,windows},
      {manufacturer,microsoft},
      {type,computer},
      {version,<<"6.0">>},
      {version_details,[{major,6},{minor,0}]}]}]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant