瀏覽代碼

geoip: set null termination to the field used for query

Daniel-Constantin Mierla 10 年之前
父節點
當前提交
ec2a72d75d
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      modules/geoip/geoip_pv.c

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