1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00

* socket.c (scm_fill_sockaddr): zero the address structure before

use, in case it has a sin_len field and the OS doesn't like random
	values (thanks to Bertrand Petit).
This commit is contained in:
Gary Houston 1999-11-04 20:04:18 +00:00
parent 4921140c64
commit 93a6b6f5a7
3 changed files with 10 additions and 0 deletions

1
THANKS
View file

@ -7,5 +7,6 @@ Bug reports and fixes from:
Lauri Alanko
Greg Harvey
Roland Orre
Bertrand Petit
Jorgen Schaefer
Bernard Urban

View file

@ -1,3 +1,9 @@
1999-11-03 Gary Houston <ghouston@freewire.co.uk>
* socket.c (scm_fill_sockaddr): zero the address structure before
use, in case it has a sin_len field and the OS doesn't like random
values (thanks to Bertrand Petit).
1999-10-26 Mark Galassi <rosalia@lanl.gov>
* gh.h, gh_data.c (gh_symbol2scm): changed gh_symbol2scm() to take

View file

@ -325,6 +325,8 @@ scm_fill_sockaddr (fam, address, args, which_arg, proc, size)
soka = (struct sockaddr_in *)
scm_must_malloc (sizeof (struct sockaddr_in), proc);
/* e.g., for BSDs which don't like invalid sin_len. */
memset (soka, 0, sizeof (struct sockaddr_in));
soka->sin_family = AF_INET;
soka->sin_addr.s_addr =
htonl (scm_num2ulong (address, (char *) which_arg, proc));
@ -344,6 +346,7 @@ scm_fill_sockaddr (fam, address, args, which_arg, proc, size)
soka = (struct sockaddr_un *)
scm_must_malloc (sizeof (struct sockaddr_un), proc);
memset (soka, 0, sizeof (struct sockaddr_un));
soka->sun_family = AF_UNIX;
SCM_ASSERT (SCM_NIMP (address) && SCM_ROSTRINGP (address), address,
which_arg, proc);