Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 387222 Details for
Bug 526244
dev-php/pecl-geoip-1.1.0 - segmentation fault in php on corrupt GeoIPCity.dat where libGeoIP returns NULL
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch to prevent segfaults in GeoIP_record_by_name() due NULL passed as first arg
geoip-1.1.0-inbox-city.patch (text/plain), 2.13 KB, created by
Deniss Gaplevsky
on 2014-10-22 18:13:38 UTC
(
hide
)
Description:
patch to prevent segfaults in GeoIP_record_by_name() due NULL passed as first arg
Filename:
MIME Type:
Creator:
Deniss Gaplevsky
Created:
2014-10-22 18:13:38 UTC
Size:
2.13 KB
patch
obsolete
>--- geoip.c.orig 2014-05-01 20:44:31.000000000 +0300 >+++ geoip.c 2014-10-22 20:54:31.000000000 +0300 >@@ -548,15 +548,18 @@ > } > > if (GeoIP_db_avail(GEOIP_CITY_EDITION_REV1) || GeoIP_db_avail(GEOIP_CITY_EDITION_REV0)) { >- if (GeoIP_db_avail(GEOIP_CITY_EDITION_REV1)) { >- gi = GeoIP_open_type(GEOIP_CITY_EDITION_REV1, GEOIP_STANDARD); >- } else { >- gi = GeoIP_open_type(GEOIP_CITY_EDITION_REV0, GEOIP_STANDARD); >+ gi = GeoIP_open_type(GEOIP_CITY_EDITION_REV0, GEOIP_STANDARD); >+ if (NULL == gi) { gi = GeoIP_open_type(GEOIP_CITY_EDITION_REV1, GEOIP_STANDARD); } >+ if (NULL == gi) { >+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't open database file"); >+ return; > } >- } else { >+ } else { > php_error_docref(NULL TSRMLS_CC, E_WARNING, "Required database not available at %s.", GeoIPDBFileName[GEOIP_CITY_EDITION_REV0]); > return; > } >+ >+ > gir = GeoIP_record_by_name(gi, hostname); > > GeoIP_delete(gi); >@@ -628,11 +631,12 @@ > } > > if (GeoIP_db_avail(GEOIP_REGION_EDITION_REV0) || GeoIP_db_avail(GEOIP_REGION_EDITION_REV1)) { >- if (GeoIP_db_avail(GEOIP_REGION_EDITION_REV1)) { >- gi = GeoIP_open_type(GEOIP_REGION_EDITION_REV1, GEOIP_STANDARD); >- } else { >- gi = GeoIP_open_type(GEOIP_REGION_EDITION_REV0, GEOIP_STANDARD); >- } >+ gi = GeoIP_open_type(GEOIP_REGION_EDITION_REV0, GEOIP_STANDARD); >+ if (NULL == gi) { gi = GeoIP_open_type(GEOIP_REGION_EDITION_REV1, GEOIP_STANDARD); } >+ if (NULL == gi) { >+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't open database file"); >+ return; >+ } > } else { > php_error_docref(NULL TSRMLS_CC, E_WARNING, "Required database not available at %s.", GeoIPDBFileName[GEOIP_REGION_EDITION_REV0]); > return;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 526244
: 387222