SHA256
1
0
forked from pool/curl
curl/curl-7.16.0-strict-aliasing.patch

31 lines
1.1 KiB
Diff

--- lib/ldap.c
+++ lib/ldap.c
@@ -204,7 +204,10 @@ static dynafunc DynaGetFunction(const ch
* cannot typecast a data pointer to a function pointer, but that's
* exactly what we need to do here to avoid compiler warnings on picky
* compilers! */
- *(void**) (&func) = dlsym(libldap, name);
+ /* mmarek@suse.cz: I guess we can live with the void* -> funcptr conversion
+ * on systems where dlsym is supported... anyway less harm that risking
+ * strict aliasing bugs... */
+ func = dlsym(libldap, name);
}
#elif defined(WIN32)
if (libldap) {
--- lib/connect.c
+++ lib/connect.c
@@ -384,11 +384,10 @@ static CURLcode bindlocal(struct connect
if( bind(sockfd, sock, socksize) >= 0) {
/* we succeeded to bind */
struct Curl_sockaddr_storage add;
- size_t size;
+ socklen_t size;
size = sizeof(add);
- if(getsockname(sockfd, (struct sockaddr *) &add,
- (socklen_t *)&size)<0) {
+ if(getsockname(sockfd, (struct sockaddr *) &add, &size)<0) {
failf(data, "getsockname() failed");
return CURLE_HTTP_PORT_FAILED;
}