[sr-dev] git:4.3:4c24d4ac: geoip: set null termination to the field used for query

Daniel-Constantin Mierla miconda at gmail.com
Fri Aug 28 12:34:57 CEST 2015


Module: kamailio
Branch: 4.3
Commit: 4c24d4acbca4e5ec99b5de1dd5f29d2cdeae9e2b
URL: https://github.com/kamailio/kamailio/commit/4c24d4acbca4e5ec99b5de1dd5f29d2cdeae9e2b

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2015-08-28T12:34:40+02:00

geoip: set null termination to the field used for query

(cherry picked from commit ec2a72d75dc0a2c9c3d88361094fdda7a7477935)

---

Modified: modules/geoip/geoip_pv.c

---

Diff:  https://github.com/kamailio/kamailio/commit/4c24d4acbca4e5ec99b5de1dd5f29d2cdeae9e2b.diff
Patch: https://github.com/kamailio/kamailio/commit/4c24d4acbca4e5ec99b5de1dd5f29d2cdeae9e2b.patch

---

diff --git a/modules/geoip/geoip_pv.c b/modules/geoip/geoip_pv.c
index 46c4dff..ba12f16 100644
--- a/modules/geoip/geoip_pv.c
+++ b/modules/geoip/geoip_pv.c
@@ -422,7 +422,7 @@ int geoip_update_pv(str *tomatch, str *name)
 	}
 
 	strncpy(gr->tomatch, tomatch->s, tomatch->len);
-	tomatch->s[tomatch->len] = '\0';
+	gr->tomatch[tomatch->len] = '\0';
 	gr->record = GeoIP_record_by_name(_handle_GeoIP,
 			(const char*)gr->tomatch);
 	LM_DBG("attempt to match: %s\n", gr->tomatch);




More information about the sr-dev mailing list