SF Bug Tracker id 3496934 - Memory leaks in getlocalhostname and UpnpGetIfInfo

Submitted: Fabrice Fontaine ( ffontaine ) - 2012-03-05 01:25:42 PST

LocalSock is not closed if ioctl(LocalSock, SIOCGIFCONF, &ifConf);
returns an error.
This commit is contained in:
Fabrice Fontaine 2012-03-05 11:27:52 +01:00
parent 69f3fe2330
commit bd203e780e
2 changed files with 12 additions and 2 deletions

View File

@ -2,6 +2,15 @@
Version 1.6.16
*******************************************************************************
2012-03-05 Fabrice Fontaine <fabrice.fontaine(at)orange.com>
SF Bug Tracker id 3496934 - Memory leaks in getlocalhostname and UpnpGetIfInfo
Submitted: Fabrice Fontaine ( ffontaine ) - 2012-03-05 01:25:42 PST
LocalSock is not closed if ioctl(LocalSock, SIOCGIFCONF, &ifConf);
returns an error.
2012-03-05 Fabrice Fontaine <fabrice.fontaine(at)orange.com>
SF Bug Tracker id 3496933 - Out-of-bounds access in CheckOtherHTTPHeaders

View File

@ -2,7 +2,7 @@
*
* Copyright (c) 2000-2003 Intel Corporation
* All rights reserved.
* Copyright (C) 2011 France Telecom All rights reserved.
* Copyright (C) 2011-2012 France Telecom All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@ -3281,6 +3281,7 @@ int UpnpGetIfInfo(const char *IfName)
if (ioctl(LocalSock, SIOCGIFCONF, &ifConf) < 0) {
UpnpPrintf(UPNP_ALL, API, __FILE__, __LINE__,
"DiscoverInterfaces: SIOCGIFCONF returned error\n");
close(LocalSock);
return UPNP_E_INIT;
}
/* Cycle through the list of interfaces looking for IP addresses. */
@ -3699,7 +3700,7 @@ int getlocalhostname(char *out, size_t out_len)
if (nResult < 0) {
UpnpPrintf(UPNP_ALL, API, __FILE__, __LINE__,
"DiscoverInterfaces: SIOCGIFCONF returned error\n");
close(LocalSock);
return UPNP_E_INIT;
}