geoip: set null termination to the field used for query
authorDaniel-Constantin Mierla <miconda@gmail.com>
Fri, 28 Aug 2015 10:31:24 +0000 (12:31 +0200)
committerDaniel-Constantin Mierla <miconda@gmail.com>
Fri, 28 Aug 2015 10:31:59 +0000 (12:31 +0200)
modules/geoip/geoip_pv.c

index 46c4dff..ba12f16 100644 (file)
@@ -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);