+static const struct bad_decode_test {
+ size_t outlen;
+ const char input[20];
+} bad_decode_tests[] = {
+ { 20, "xn--e-*" }, /* bad digit '*' */
+ { 10, "xn--e-999" }, /* loop > enc_len */
+ { 20, "xn--e-999999999" }, /* Too big */
+ { 20, {'x', 'n', '-', '-', (char)0x80, '-' } }, /* Not basic */
+ { 20, "xn--e-Oy65t" }, /* codepoint > 0x10FFFF */
+};
+
+static int test_a2ulabel_bad_decode(int tst)
+{
+ char out[20];
+
+ return TEST_int_eq(ossl_a2ulabel(bad_decode_tests[tst].input, out, bad_decode_tests[tst].outlen), -1);
+}
+