Browse code

geoip: set null termination to the field used for query

Daniel-Constantin Mierla authored on 28/08/2015 10:31:24
Showing 1 changed files
... ...
@@ -422,7 +422,7 @@ int geoip_update_pv(str *tomatch, str *name)
422 422
 	}
423 423
 
424 424
 	strncpy(gr->tomatch, tomatch->s, tomatch->len);
425
-	tomatch->s[tomatch->len] = '\0';
425
+	gr->tomatch[tomatch->len] = '\0';
426 426
 	gr->record = GeoIP_record_by_name(_handle_GeoIP,
427 427
 			(const char*)gr->tomatch);
428 428
 	LM_DBG("attempt to match: %s\n", gr->tomatch);