From 9e0ad3049dbae88d615bfb038e53bf365a39a634 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Sat, 11 Nov 2017 11:41:45 +0100 Subject: resolv: ns_name_pton should report trailing \ as error [BZ #22413] --- resolv/ns_name.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'resolv/ns_name.c') diff --git a/resolv/ns_name.c b/resolv/ns_name.c index 08a75e2..73213fe 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); -- cgit v1.1