Skip to content

Commit

Permalink
geoip: set null termination to the field used for query
Browse files Browse the repository at this point in the history
(cherry picked from commit ec2a72d)
(cherry picked from commit 4c24d4a)
(cherry picked from commit 0b18aea)
  • Loading branch information
miconda committed Dec 18, 2015
1 parent eaeb67d commit bd71f80
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/geoip/geoip_pv.c
Expand Up @@ -415,7 +415,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);
Expand Down

0 comments on commit bd71f80

Please sign in to comment.