mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Alexey Izbyshev <>
Subject: [musl] [PATCH] fix potential read past end of buffer in getnameinfo host name lookup
Date: Sat, 25 Feb 2023 18:41:32 +0300	[thread overview]
Message-ID: <> (raw)

This is completely analoguous to commit 633183b5d1c2.

Similar code called from __lookup_name is not affected because it checks
that the line contains the host name surrounded by blanks.
 src/network/getnameinfo.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/network/getnameinfo.c b/src/network/getnameinfo.c
index 949e1811..689b7d11 100644
--- a/src/network/getnameinfo.c
+++ b/src/network/getnameinfo.c
@@ -58,6 +58,7 @@ static void reverse_hosts(char *buf, const unsigned char *a, unsigned scopeid, i
 		if ((p=strchr(line, '#'))) *p++='\n', *p=0;
 		for (p=line; *p && !isspace(*p); p++);
+		if (!*p) continue;
 		*p++ = 0;
 		if (__lookup_ipliteral(&iplit, line, AF_UNSPEC)<=0)

                 reply	other threads:[~2023-02-25 15:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* 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

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 NNTP newsgroup(s).