2
0
Эх сурвалжийг харах

geoip: set null termination to the field used for query

Daniel-Constantin Mierla 10 жил өмнө
parent
commit
ec2a72d75d

+ 1 - 1
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);