Fix alignment errors in hashtable fuzzer
[openssl.git] / test / ocspapitest.c
index ad3b6cac67206acdae3d2ed61777263e1cb93e27..13026d6b4a42b5f10135a1b18c3ac2cc0e3a9bfb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2017-2023 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -78,10 +78,14 @@ static OCSP_BASICRESP *make_dummy_resp(void)
     ASN1_BIT_STRING *key = ASN1_BIT_STRING_new();
     ASN1_INTEGER *serial = ASN1_INTEGER_new();
 
-    if (!X509_NAME_add_entry_by_NID(name, NID_commonName, MBSTRING_ASC,
-                                   namestr, -1, -1, 1)
-        || !ASN1_BIT_STRING_set(key, keybytes, sizeof(keybytes))
-        || !ASN1_INTEGER_set_uint64(serial, (uint64_t)1))
+    if (!TEST_ptr(name)
+        || !TEST_ptr(key)
+        || !TEST_ptr(serial)
+        || !TEST_true(X509_NAME_add_entry_by_NID(name, NID_commonName,
+                                                 MBSTRING_ASC,
+                                                 namestr, -1, -1, 1))
+        || !TEST_true(ASN1_BIT_STRING_set(key, keybytes, sizeof(keybytes)))
+        || !TEST_true(ASN1_INTEGER_set_uint64(serial, (uint64_t)1)))
         goto err;
     cid = OCSP_cert_id_new(EVP_sha256(), name, key, serial);
     if (!TEST_ptr(bs)
@@ -189,7 +193,7 @@ static int test_ocsp_url_svcloc_new(void)
     };
 
     X509 *issuer = NULL;
-    X509_EXTENSION * ext = NULL;
+    X509_EXTENSION *ext = NULL;
     int ret = 0;
 
     if (!TEST_true(get_cert(&issuer)))