You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/dev-libs/ucommon/files/ucommon-5.2.2-address.patch

43 lines
1.3 KiB

This patch fixes memory errors
Author: David Sugar
--- commoncpp/address.cpp
+++ commoncpp/address.cpp
@@ -360,7 +360,7 @@
if(ipaddr)
delete[] ipaddr;
ipaddr = new struct in_addr[1];
- memset((void *)&ipaddr[0], 0, sizeof(ipaddr));
+ memset((void *)&ipaddr[0], 0, sizeof(struct in_addr));
return;
}
@@ -498,7 +498,7 @@
: validator(_validator), hostname(NULL) {
addr_count = 1;
ipaddr = new struct in6_addr[1];
- memcpy(ipaddr, &in6addr_any, sizeof(in6_addr));
+ memcpy(ipaddr, &in6addr_any, sizeof(struct in6_addr));
}
IPV6Address::IPV6Address(const char *address, const IPV6Validator *_validator) :
@@ -716,7 +716,7 @@
if(ipaddr)
delete[] ipaddr;
ipaddr = new struct in6_addr[1];
- memset((void *)&ipaddr[0], 0, sizeof(ipaddr));
+ memset((void *)&ipaddr[0], 0, sizeof(struct in6_addr));
return;
}
@@ -796,7 +796,7 @@
if(ipaddr)
delete[] ipaddr;
ipaddr = new struct in6_addr[1];
- memset((void *)&ipaddr[0], 0, sizeof(ipaddr));
+ memset((void *)&ipaddr[0], 0, sizeof(struct in6_addr));
return;
}