about summary refs log tree commit diff
path: root/resolv/ns_name.c
diff options
context:
space:
mode:
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);