aports/main/busybox/0005-libbb-sockaddr2str-ensure-only-printable-characters-.patch
Sören Tempel 531e69840c main/busybox: upgrade to 1.37.0
Not a lot of big changes in this release, mostly code shrinks and bug
fixes here and there. Hence, I don't expect too much breakage. Most patches
applied as is and didn't require any changes either. Nonetheless, I
rebased the entire patchset and removed patches that were backported.

The 0001-modutils-check-ELF-header-before-calling-finit_modul.patch
should be superseded by an upstream modutils change which checks that
if the loaded module file path ends in .ko and if not attempts to
uncompress it first. Thereby preventing compressed modules to be
passed to the kernel and causing a weird error to be emitted. Therefore,
this patch was removed

See: https://git.busybox.net/busybox/commit/?id=af5277f883e8fc2e0236aa9ecc5115ecaffd0ccb
2024-10-20 10:16:15 +00:00

37 lines
1.3 KiB
Diff

From a8a43d8092563a62349e0c9b5db3926bb3e02f94 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Sun, 3 Apr 2022 18:13:37 +0000
Subject: [PATCH] libbb: sockaddr2str: ensure only printable characters are
returned for the hostname part
CVE: Pending
Upstream-Status: Pending
Signed-off-by: Ariadne Conill <ariadne@dereferenced.org>
---
libbb/xconnect.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/libbb/xconnect.c b/libbb/xconnect.c
index 0e0b247b8..02c061e67 100644
--- a/libbb/xconnect.c
+++ b/libbb/xconnect.c
@@ -497,8 +497,9 @@ static char* FAST_FUNC sockaddr2str(const struct sockaddr *sa, int flags)
);
if (rc)
return NULL;
+ /* ensure host contains only printable characters */
if (flags & IGNORE_PORT)
- return xstrdup(host);
+ return xstrdup(printable_string(host));
#if ENABLE_FEATURE_IPV6
if (sa->sa_family == AF_INET6) {
if (strchr(host, ':')) /* heh, it's not a resolved hostname */
@@ -509,7 +510,7 @@ static char* FAST_FUNC sockaddr2str(const struct sockaddr *sa, int flags)
#endif
/* For now we don't support anything else, so it has to be INET */
/*if (sa->sa_family == AF_INET)*/
- return xasprintf("%s:%s", host, serv);
+ return xasprintf("%s:%s", printable_string(host), serv);
/*return xstrdup(host);*/
}