Module: kamailio
Branch: master
Commit: ec2a72d75dc0a2c9c3d88361094fdda7a7477935
URL:
https://github.com/kamailio/kamailio/commit/ec2a72d75dc0a2c9c3d88361094fdda…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-08-28T12:31:59+02:00
geoip: set null termination to the field used for query
---
Modified: modules/geoip/geoip_pv.c
---
Diff:
https://github.com/kamailio/kamailio/commit/ec2a72d75dc0a2c9c3d88361094fdda…
Patch:
https://github.com/kamailio/kamailio/commit/ec2a72d75dc0a2c9c3d88361094fdda…
---
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);