Tweak x509_constraints_uri_host() regress to test for NULL deref in
authortb <tb@openbsd.org>
Mon, 28 Nov 2022 07:24:03 +0000 (07:24 +0000)
committertb <tb@openbsd.org>
Mon, 28 Nov 2022 07:24:03 +0000 (07:24 +0000)
fixed in x509_constraints.c r1.29.

regress/lib/libcrypto/x509/constraints.c

index d3fdf0e..8771367 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: constraints.c,v 1.14 2022/11/23 23:06:16 kn Exp $     */
+/*     $OpenBSD: constraints.c,v 1.15 2022/11/28 07:24:03 tb Exp $     */
 /*
  * Copyright (c) 2020 Bob Beck <beck@openbsd.org>
  *
@@ -466,6 +466,8 @@ test_constraints1(void)
                        char *hostpart = NULL;
                        error = 0;
                        if (!x509_constraints_uri_host(noauthority[j],
+                           strlen(noauthority[j]), NULL) ||
+                           !x509_constraints_uri_host(noauthority[j],
                            strlen(noauthority[j]), &hostpart)) {
                                FAIL("name '%s' should parse as a URI",
                                    noauthority[j]);