diff --git a/src/ChangeLog b/src/ChangeLog index 9fed7116..f1ff7e1e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2001-04-30 Hrvoje Niksic + + * init.c (cmd_address): Zero SIN before using it; apparently + needed on *BSD. + 2001-04-29 Hrvoje Niksic * ftp.c (ftp_loop_internal): Don't set NO_TRUNCATE if the file is diff --git a/src/init.c b/src/init.c index 62115a86..5cbb2ff5 100644 --- a/src/init.c +++ b/src/init.c @@ -521,13 +521,14 @@ cmd_address (const char *com, const char *val, void *closure) struct sockaddr_in sin; struct sockaddr_in **target = (struct sockaddr_in **)closure; + memset (&sin, '\0', sizeof (sin)); + if (!store_hostaddress ((unsigned char *)&sin.sin_addr, val)) { fprintf (stderr, _("%s: %s: Cannot convert `%s' to an IP address.\n"), exec_name, com, val); return 0; } - sin.sin_family = AF_INET; sin.sin_port = 0;