mirror of
https://github.com/sheumann/hush.git
synced 2024-12-28 07:30:23 +00:00
Fix a bug pointed out by Rob Landley <rlandley@austin.rr.com>, where
setup_sockaddr_in was zeroing the sizeof a pointer, not the sizeof the struct, which was obviously what was intended. Thanks Rob, -Erik
This commit is contained in:
parent
341744781a
commit
8b96032139
@ -612,7 +612,7 @@ static int create_socket()
|
|||||||
|
|
||||||
static void setup_sockaddr_in(struct sockaddr_in * addr, int port)
|
static void setup_sockaddr_in(struct sockaddr_in * addr, int port)
|
||||||
{
|
{
|
||||||
memset(addr, 0, sizeof addr);
|
memset(addr, 0, sizeof(struct sockaddr_in));
|
||||||
addr->sin_family = AF_INET;
|
addr->sin_family = AF_INET;
|
||||||
addr->sin_port = htons(port);
|
addr->sin_port = htons(port);
|
||||||
}
|
}
|
||||||
|
2
telnet.c
2
telnet.c
@ -612,7 +612,7 @@ static int create_socket()
|
|||||||
|
|
||||||
static void setup_sockaddr_in(struct sockaddr_in * addr, int port)
|
static void setup_sockaddr_in(struct sockaddr_in * addr, int port)
|
||||||
{
|
{
|
||||||
memset(addr, 0, sizeof addr);
|
memset(addr, 0, sizeof(struct sockaddr_in));
|
||||||
addr->sin_family = AF_INET;
|
addr->sin_family = AF_INET;
|
||||||
addr->sin_port = htons(port);
|
addr->sin_port = htons(port);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user