[PATCH] smtp-dummy: clear sockaddr_in structure before use in bind()
Any junk bytes in sockaddr_in structure before passing that to bind() system call may cause problems. --- Thanks Austin. Consistent style matters... And dropped the peer_addr setting after reading accept(2) namual page. test/smtp-dummy.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/test/smtp-dummy.c b/test/smtp-dummy.c index 9da8202..1778a45 100644 --- a/test/smtp-dummy.c +++ b/test/smtp-dummy.c @@ -159,6 +159,7 @@ main (int argc, char *argv[]) return 1; } + memset (, 0, sizeof (addr)); addr.sin_family = AF_INET; addr.sin_port = htons (25025); addr.sin_addr = *(struct in_addr *) hostinfo->h_addr; -- 1.5.6.5
[PATCH] smtp-dummy: clear sockaddr_in structure before use in bind()
On Sat, 12 Nov 2011 11:57:22 +0200, Tomi Ollila wrote: > Any junk bytes in sockaddr_in structure before passing that > to bind() system call may cause problems. > --- Pushed the second version. d
[PATCH] smtp-dummy: clear sockaddr_in structure before use in bind()
Any junk bytes in sockaddr_in structure before passing that to bind() system call may cause problems. --- Thanks Austin. Consistent style matters... And dropped the peer_addr setting after reading accept(2) namual page. test/smtp-dummy.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/test/smtp-dummy.c b/test/smtp-dummy.c index 9da8202..1778a45 100644 --- a/test/smtp-dummy.c +++ b/test/smtp-dummy.c @@ -159,6 +159,7 @@ main (int argc, char *argv[]) return 1; } + memset (addr, 0, sizeof (addr)); addr.sin_family = AF_INET; addr.sin_port = htons (25025); addr.sin_addr = *(struct in_addr *) hostinfo-h_addr; -- 1.5.6.5 ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
Re: [PATCH] smtp-dummy: clear sockaddr_in structure before use in bind()
On Sat, 12 Nov 2011 11:57:22 +0200, Tomi Ollila tomi.oll...@iki.fi wrote: Any junk bytes in sockaddr_in structure before passing that to bind() system call may cause problems. --- Pushed the second version. d ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch