2017-11-11 Florian Weimer <fweimer@redhat.com>
+ [BZ #22413]
+ * resolv/ns_name.c (ns_name_pton): Treat trailing backslash as error.
+ * resolv/tst-ns_name_pton.c (tests): Add trailing backslash tests.
+
+2017-11-11 Florian Weimer <fweimer@redhat.com>
+
* resolv/tst-ns_name_pton.c: New file.
* resolv/Makefile (tests): Add tst-ns_name_pton.
(tst-ns_name_pton): Link against libresolv.
}
*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);
"\377\377", NULL, },
{ STRING63OCT "." STRING63OCT "." STRING63OCT "." STRING60OCT
"\377\377\377", NULL, },
+ { "\\", NULL, },
+ { "\\\\", "\\\\", false },
+ { "\\\\.", "\\\\", true },
+ { "\\\\\\", NULL, },
+ { "a\\", NULL, },
+ { "a.\\", NULL, },
+ { "a.b\\", NULL, },
};
static int