mirror of
https://github.com/rofl0r/proxychains-ng.git
synced 2024-12-22 12:18:47 +00:00
allocator_thread: add assertion that we get the right response
in order to prevent future bugs like the one fixed in cc7bc891ff
we need to assure that the response is of the same type as the request -
if not, some unexpected race condition happened.
This commit is contained in:
parent
cc7bc891ff
commit
03880ce695
@ -289,6 +289,7 @@ ip_type4 at_get_ip_for_host(char* host, size_t len) {
|
||||
inv:
|
||||
readbuf = ip_type_invalid.addr.v4;
|
||||
}
|
||||
assert(msg.msgtype == ATM_GETIP);
|
||||
MUTEX_UNLOCK(internal_ips_lock);
|
||||
return readbuf;
|
||||
}
|
||||
@ -301,6 +302,7 @@ size_t at_get_host_for_ip(ip_type4 ip, char* readbuf) {
|
||||
if((ptrdiff_t) msg.datalen <= 0) res = 0;
|
||||
else res = msg.datalen - 1;
|
||||
}
|
||||
assert(msg.msgtype == ATM_GETNAME);
|
||||
MUTEX_UNLOCK(internal_ips_lock);
|
||||
return res;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user