mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-28 06:13:31 +01:00
Fix a couple more places where we use ->new_address without checking that it is there.
svn:r3907
This commit is contained in:
parent
0e26973c02
commit
1612df7b2c
@ -760,7 +760,7 @@ addressmap_register_virtual_address(int type, char *new_address)
|
||||
&vent->ipv4_address : &vent->hostname_address;
|
||||
if (*addrp) {
|
||||
addressmap_entry_t *ent = strmap_get(addressmap, *addrp);
|
||||
if (ent && !strcasecmp(new_address, ent->new_address)) {
|
||||
if (ent && ent->new_address && !strcasecmp(new_address, ent->new_address)) {
|
||||
tor_free(new_address);
|
||||
return tor_strdup(*addrp);
|
||||
} else
|
||||
@ -822,7 +822,7 @@ addressmap_get_mappings(smartlist_t *sl, time_t min_expires, time_t max_expires)
|
||||
addressmap_ent_remove(key, val);
|
||||
iter = strmap_iter_next_rmv(addressmap,iter);
|
||||
continue;
|
||||
} else {
|
||||
} else if (val->new_address) {
|
||||
size_t len = strlen(key)+strlen(val->new_address)+2;
|
||||
char *line = tor_malloc(len);
|
||||
tor_snprintf(line, len, "%s %s", key, val->new_address);
|
||||
|
Loading…
Reference in New Issue
Block a user