mirror of
https://github.com/glest/glest-source.git
synced 2025-08-18 14:11:15 +02:00
- updated code to protect against null pointers and uninitialized values and threading issues
This commit is contained in:
@@ -143,7 +143,8 @@ int connecthostport(const char * host, unsigned short port,
|
||||
hints.ai_socktype = SOCK_STREAM;
|
||||
hints.ai_family = AF_UNSPEC; /* AF_INET, AF_INET6 or AF_UNSPEC */
|
||||
/* hints.ai_protocol = IPPROTO_TCP; */
|
||||
snprintf(port_str, sizeof(port_str), "%hu", port);
|
||||
snprintf(port_str, 7, "%hu", port);
|
||||
port_str[7] = '\0';
|
||||
if(host[0] == '[')
|
||||
{
|
||||
/* literal ip v6 address */
|
||||
|
@@ -2465,7 +2465,7 @@ int UPNP_Tools::upnp_init(void *param) {
|
||||
}
|
||||
|
||||
dev = devlist;
|
||||
while (dev) {
|
||||
while (dev && dev->st) {
|
||||
if (strstr(dev->st, "InternetGatewayDevice")) {
|
||||
break;
|
||||
}
|
||||
|
@@ -297,6 +297,9 @@ int glob( char const *pattern
|
||||
cbAlloc = new_cbAlloc;
|
||||
}
|
||||
|
||||
if(buffer == NULL) {
|
||||
throw exception("buffer == NULL");
|
||||
}
|
||||
(void)lstrcpynA(buffer + cbCurr, szRelative, 1 + (int)(file_part - effectivePattern));
|
||||
(void)lstrcatA(buffer + cbCurr, sFileName.c_str());
|
||||
cbCurr += cch + 1;
|
||||
|
Reference in New Issue
Block a user