diff --git a/ipcalc-0.2.4-fix-segfault.patch b/ipcalc-0.2.4-fix-segfault.patch new file mode 100644 index 0000000..b63aa03 --- /dev/null +++ b/ipcalc-0.2.4-fix-segfault.patch @@ -0,0 +1,14 @@ +diff --git a/ipcalc-maxmind.c b/ipcalc-maxmind.c +index bb4f495..6f0033b 100644 +--- a/ipcalc-maxmind.c ++++ b/ipcalc-maxmind.c +@@ -113,6 +113,9 @@ void geo_ip_lookup(const char *ip, char **country, char **ccode, char **city, ch + int gai_error, mmdb_error, status, coordinates=0; + double latitude, longitude; + ++ if (geo_setup() != 0) ++ return; ++ + /* Open the system maxmind database with countries */ + status = pMMDB_open(MAXMINDDB_LOCATION_COUNTRY, MMDB_MODE_MMAP, &mmdb); + if (MMDB_SUCCESS == status) { diff --git a/ipcalc.spec b/ipcalc.spec index 9380cc9..90541ef 100644 --- a/ipcalc.spec +++ b/ipcalc.spec @@ -1,7 +1,8 @@ Name: ipcalc Version: 0.2.4 -Release: 1%{?dist} +Release: 2%{?dist} Summary: IP network address calculator +Patch1: ipcalc-0.2.4-fix-segfault.patch # This is an updated version of ipcalc originally found # in Fedora's initscripts at: @@ -28,7 +29,7 @@ parsing in scripts, generate random private addresses, resolve an IP address, or check the validity of an address. %prep -%setup -q +%autosetup %build CFLAGS="${CFLAGS:-%optflags} $RPM_LD_FLAGS" \ @@ -51,6 +52,9 @@ make check %{_mandir}/man1/ipcalc.1* %changelog +* Thu Aug 09 2018 Nikos Mavrogiannopoulos - 0.2.4-2 +- Fix crash when -g option is used + * Mon Jul 23 2018 Nikos Mavrogiannopoulos - 0.2.4-1 - New upstream release