dev-php/pecl-geoip-1.1.0 segfaults php when GeoIPCity.dat is used.
There is bug filled to mainstream with patch at https://bugs.php.net/bug.php?id=68277
The upstream bug report seems to be about a segmentation fault in libGeoIP, which is in the domain of dev-libs/geoip, not dev-php/pecl-geoip.
1) Please post your `emerge --info dev-libs/geoip' output in a comment.
2) Please explain how that broken database got there. :)
the issue is pretty complex and comes out from libgeoip sins:
1. GeoIP_db_avail() does not make difference between GEOIP_*_EDITION_REV1 and GEOIP_*_EDITION_REV0 but GeoIP_open_type() does.
2. GeoIP_open_type() returns NULL when requested revision does not match actual revision of file. NULL is returned for few other cases as well.
3. GeoIP_record_by_name() (and other GeoIP_*_by_name()?) does not check first argument for NULL and segfaults.
I contacted Boris Zentner (MaxMind) and he wrote me back that the pecl-geoip should manage all checks.
A patch attached tries to open the file as GEOIP_CITY_EDITION_REV0 then as GEOIP_CITY_EDITION_REV1 if failed and finally check returned value for NULL
Created attachment 387222 [details, diff]
patch to prevent segfaults in GeoIP_record_by_name() due NULL passed as first arg
this patch also fixes wrong revision guessing
mainstream patch available from https://bugs.php.net/bug.php?id=68277