juliensobrier / Net-Google-SafeBrowsing4

Net::Google::SafeBrowsing4 - Perl library for Google Safebrowsing v4
Apache License 2.0
2 stars 4 forks source link

Hash method called on undefined value on line 434 of SafeBrowsing4.pm #10

Closed djugessur closed 7 years ago

djugessur commented 7 years ago

Hi,

While doing more tests, I have run into issues where the hash function is being called on undefined values on line 434 of SafeBrowsing4.pm. I have attached a patch for this

URI.patch.txt

Thanks

Deepu

djugessur commented 7 years ago

I noticed another issue with this. If you run with the following 2 links:

http://jakuboweb.com/message.html http://www.yac.mx?source=3Demail

The first one is not caught despite being in the safe browsing db.

Here is a patch to address this:

URI.patch2.txt

The real fix however would involve a modification of the regex to handle the second link, as browsers tend to insert the "/" char before the "?".

Thanks

Deepu

geever commented 7 years ago

Applied your first patch. About the second: It actually revealed a normalizing bug a slash should have been added between the domain and the query. I'll look into that.

geever commented 7 years ago

Fixed the normalization and updated the splitting logic as well. I hope it is all good now. Thanks for reporting!