juliensobrier / Net-Google-SafeBrowsing4

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

Crash when gsb->update() is called the first time #23

Closed llkhacquan closed 5 years ago

llkhacquan commented 5 years ago

I meet this bug when gsb->update() is called the first time. (storage is empty).

2019/03/05 20:30:01 Load /etc/coccoc-gsb4/data/updates.gdb4 (reset)
2019/03/05 20:30:01 time for update: 0 / 1551792601.67377
Can't use an undefined value as an ARRAY reference at /usr/local/share/perl/5.26.1/Net/Google/SafeBrowsing4.pm line 693.

Hope this helps.

geever commented 5 years ago

@llkhacquan Could you show us your script, and/or a more detailed reproduction plan, and version of your GSB module. Line 693 should only die on empty lists which should not happen :)

llkhacquan commented 5 years ago

I used the latest gsb4 version from cpan sudo cpan intall Net::Google::SafeBrowsing4 Note that this crash does not always happen. The script is very simple here. After few debuggings, I think the reason can be:

geever commented 5 years ago

Thanks for the clarification, I managed to reproduce the issue. 4e4019feb4e471622d7544907a6a90c10a6bc92c addresses that issue, update will return with SERVER_ERROR if $all_lists is undef.