Fix crash when -g option is used
This commit is contained in:
parent
61f0b682aa
commit
6aa6a9e298
14
ipcalc-0.2.4-fix-segfault.patch
Normal file
14
ipcalc-0.2.4-fix-segfault.patch
Normal file
@ -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) {
|
||||
@ -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 <nmav@redhat.com> - 0.2.4-2
|
||||
- Fix crash when -g option is used
|
||||
|
||||
* Mon Jul 23 2018 Nikos Mavrogiannopoulos <nmav@redhat.com> - 0.2.4-1
|
||||
- New upstream release
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user