From ec2a72d75dc0a2c9c3d88361094fdda7a7477935 Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Fri, 28 Aug 2015 12:31:24 +0200 Subject: [PATCH] geoip: set null termination to the field used for query --- modules/geoip/geoip_pv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/geoip/geoip_pv.c b/modules/geoip/geoip_pv.c index 46c4dff4cdd..ba12f16015d 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);