Fossil SCM
Reset memory in addr for good measure just to be certain nothing is left over.
Commit
522cf5f66db5a6ee54bdc30e0f0468460f45fbf0
Parent
f627634ca89c855…
1 file changed
+1
+1
| --- src/http_socket.c | ||
| +++ src/http_socket.c | ||
| @@ -138,10 +138,11 @@ | ||
| 138 | 138 | int socket_open(UrlData *pUrlData){ |
| 139 | 139 | static struct sockaddr_in addr; /* The server address */ |
| 140 | 140 | |
| 141 | 141 | socket_global_init(); |
| 142 | 142 | if( !addrIsInit ){ |
| 143 | + memset(&addr, 0, sizeof(addr)); | |
| 143 | 144 | addr.sin_family = AF_INET; |
| 144 | 145 | addr.sin_port = htons(pUrlData->port); |
| 145 | 146 | *(int*)&addr.sin_addr = inet_addr(pUrlData->name); |
| 146 | 147 | if( -1 == *(int*)&addr.sin_addr ){ |
| 147 | 148 | #ifndef FOSSIL_STATIC_LINK |
| 148 | 149 |
| --- src/http_socket.c | |
| +++ src/http_socket.c | |
| @@ -138,10 +138,11 @@ | |
| 138 | int socket_open(UrlData *pUrlData){ |
| 139 | static struct sockaddr_in addr; /* The server address */ |
| 140 | |
| 141 | socket_global_init(); |
| 142 | if( !addrIsInit ){ |
| 143 | addr.sin_family = AF_INET; |
| 144 | addr.sin_port = htons(pUrlData->port); |
| 145 | *(int*)&addr.sin_addr = inet_addr(pUrlData->name); |
| 146 | if( -1 == *(int*)&addr.sin_addr ){ |
| 147 | #ifndef FOSSIL_STATIC_LINK |
| 148 |
| --- src/http_socket.c | |
| +++ src/http_socket.c | |
| @@ -138,10 +138,11 @@ | |
| 138 | int socket_open(UrlData *pUrlData){ |
| 139 | static struct sockaddr_in addr; /* The server address */ |
| 140 | |
| 141 | socket_global_init(); |
| 142 | if( !addrIsInit ){ |
| 143 | memset(&addr, 0, sizeof(addr)); |
| 144 | addr.sin_family = AF_INET; |
| 145 | addr.sin_port = htons(pUrlData->port); |
| 146 | *(int*)&addr.sin_addr = inet_addr(pUrlData->name); |
| 147 | if( -1 == *(int*)&addr.sin_addr ){ |
| 148 | #ifndef FOSSIL_STATIC_LINK |
| 149 |