aboutsummaryrefslogtreecommitdiffstats
path: root/main/musl/0001-fix-handling-of-zero-length-domain-names-in-dn_expan.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/musl/0001-fix-handling-of-zero-length-domain-names-in-dn_expan.patch')
-rw-r--r--main/musl/0001-fix-handling-of-zero-length-domain-names-in-dn_expan.patch29
1 files changed, 29 insertions, 0 deletions
diff --git a/main/musl/0001-fix-handling-of-zero-length-domain-names-in-dn_expan.patch b/main/musl/0001-fix-handling-of-zero-length-domain-names-in-dn_expan.patch
new file mode 100644
index 0000000000..266b976c16
--- /dev/null
+++ b/main/musl/0001-fix-handling-of-zero-length-domain-names-in-dn_expan.patch
@@ -0,0 +1,29 @@
+From ea35594b2a54c1652bb8ffb04183180ad7325779 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Wed, 13 Aug 2014 08:41:38 +0200
+Subject: [PATCH] fix handling of zero length domain names in dn_expand
+
+Copy a zero length string instead of returning error when trying to
+expand a zero lentgh domain name (null terminator).
+
+This fixes a regression introduced with 56b57f37a46dab432.
+---
+ src/network/dn_expand.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/network/dn_expand.c b/src/network/dn_expand.c
+index 849df19..3264faf 100644
+--- a/src/network/dn_expand.c
++++ b/src/network/dn_expand.c
+@@ -6,7 +6,7 @@ int __dn_expand(const unsigned char *base, const unsigned char *end, const unsig
+ const unsigned char *p = src;
+ char *dend = dest + (space > 254 ? 254 : space);
+ int len = -1, i, j;
+- if (p==end || !*p) return -1;
++ if (p==end) return -1;
+ /* detect reference loop using an iteration counter */
+ for (i=0; i < end-base; i+=2) {
+ if (*p & 0xc0) {
+--
+2.0.4
+