mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-24 22:58:50 +01:00
Avoid freeing an uninitialised pointer in get_interface_addresses_ioctl
This commit is contained in:
parent
9fc472e1a8
commit
2627299ef0
2 changed files with 9 additions and 1 deletions
8
changes/bug18454
Normal file
8
changes/bug18454
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
o Minor bugfixes (memory safety):
|
||||||
|
- Avoid freeing an uninitialised pointer when opening a socket fails
|
||||||
|
in get_interface_addresses_ioctl.
|
||||||
|
Fixes bug 18454; bugfix on 9f06ec0c in tor-0.2.3.11-alpha.
|
||||||
|
Reported by "toralf" and "cypherpunks", patch by "teor".
|
||||||
|
- Correctly duplicate addresses in get_interface_address6_list.
|
||||||
|
Fixes bug 18454; bugfix on 110765f5 in tor-0.2.8.1-alpha.
|
||||||
|
Reported by "toralf", patch by "cypherpunks".
|
|
@ -1525,6 +1525,7 @@ get_interface_addresses_ioctl(int severity, sa_family_t family)
|
||||||
{
|
{
|
||||||
/* Some older unixy systems make us use ioctl(SIOCGIFCONF) */
|
/* Some older unixy systems make us use ioctl(SIOCGIFCONF) */
|
||||||
struct ifconf ifc;
|
struct ifconf ifc;
|
||||||
|
ifc.ifc_buf = NULL;
|
||||||
int fd;
|
int fd;
|
||||||
smartlist_t *result = NULL;
|
smartlist_t *result = NULL;
|
||||||
|
|
||||||
|
@ -1547,7 +1548,6 @@ get_interface_addresses_ioctl(int severity, sa_family_t family)
|
||||||
}
|
}
|
||||||
|
|
||||||
int mult = 1;
|
int mult = 1;
|
||||||
ifc.ifc_buf = NULL;
|
|
||||||
do {
|
do {
|
||||||
mult *= 2;
|
mult *= 2;
|
||||||
ifc.ifc_len = mult * IFREQ_SIZE;
|
ifc.ifc_len = mult * IFREQ_SIZE;
|
||||||
|
|
Loading…
Add table
Reference in a new issue