From: Tomi Ollila <tomi.ollila@iki.fi>
To: <notmuch@notmuchmail.org>
Subject: [PATCH] smtp-dummy: clear sockaddr_in structures before use.
Date: Fri, 11 Nov 2011 01:32:20 +0200 [thread overview]
Message-ID: <yf6k477a70b.fsf@taco2.nixu.fi> (raw)
Any junk bytes in sockaddr_in structures before passing those
to bind() or accept() functions may cause problems.
---
test/smtp-dummy.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/test/smtp-dummy.c b/test/smtp-dummy.c
index 9da8202..38d1d62 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;
@@ -178,6 +179,7 @@ main (int argc, char *argv[])
return 1;
}
+ memset (&peer_addr, 0, sizeof peer_addr);
peer_addr_len = sizeof (peer_addr);
peer = accept (sock, (struct sockaddr *) &peer_addr, &peer_addr_len);
if (peer == -1) {
--
1.5.6.5
next reply other threads:[~2011-11-10 23:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-10 23:32 Tomi Ollila [this message]
2011-11-12 2:40 ` [PATCH] smtp-dummy: clear sockaddr_in structures before use Austin Clements
2011-11-12 9:57 ` [PATCH] smtp-dummy: clear sockaddr_in structure before use in bind() Tomi Ollila
2011-11-12 12:55 ` David Bremner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=yf6k477a70b.fsf@taco2.nixu.fi \
--to=tomi.ollila@iki.fi \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).