about summary refs log tree commit diff
path: root/resolv/ns_name.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2017-11-11 11:41:45 +0100
committerFlorian Weimer <fweimer@redhat.com>2017-11-11 11:41:45 +0100
commit9e0ad3049dbae88d615bfb038e53bf365a39a634 (patch)
treed32e5a7fdec7a85c68fe33208868a46bdab441dd /resolv/ns_name.c
parente2a9fca8101443076235a8dbcfceaa2d96bf4801 (diff)
downloadglibc-9e0ad3049dbae88d615bfb038e53bf365a39a634.tar.gz
glibc-9e0ad3049dbae88d615bfb038e53bf365a39a634.tar.xz
glibc-9e0ad3049dbae88d615bfb038e53bf365a39a634.zip
resolv: ns_name_pton should report trailing \ as error [BZ #22413]
Diffstat (limited to 'resolv/ns_name.c')
-rw-r--r--resolv/ns_name.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/resolv/ns_name.c b/resolv/ns_name.c
index 08a75e2fe0..73213fee2d 100644
--- a/resolv/ns_name.c
+++ b/resolv/ns_name.c
@@ -222,6 +222,11 @@ ns_name_pton(const char *src, u_char *dst, size_t dstsiz)
 		}
 		*bp++ = (u_char)c;
 	}
+	if (escaped) {
+		/* Trailing backslash.  */
+		__set_errno (EMSGSIZE);
+		return -1;
+	}
 	c = (bp - label - 1);
 	if ((c & NS_CMPRSFLGS) != 0) {		/*%< Label too big. */
 		__set_errno (EMSGSIZE);