Commit 97fc797b authored by Geoff Simmons's avatar Geoff Simmons

check a pointer before using it

parent 5658f3cf
Pipeline #103 skipped
...@@ -470,13 +470,13 @@ vmod_hmac__init(VRT_CTX, struct vmod_blobdigest_hmac **hmacp, ...@@ -470,13 +470,13 @@ vmod_hmac__init(VRT_CTX, struct vmod_blobdigest_hmac **hmacp,
enum algorithm hash = parse_algorithm(hashs); enum algorithm hash = parse_algorithm(hashs);
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
AN(vcl_name);
if (key == NULL || key->priv == NULL) { if (key == NULL || key->priv == NULL) {
VERR(ctx, "key is NULL in %s constructor", vcl_name); VERR(ctx, "key is NULL in %s constructor", vcl_name);
return; return;
} }
AN(hmacp); AN(hmacp);
AZ(*hmacp); AZ(*hmacp);
AN(vcl_name);
ALLOC_OBJ(hmac, VMOD_BLOBDIGEST_HMAC_MAGIC); ALLOC_OBJ(hmac, VMOD_BLOBDIGEST_HMAC_MAGIC);
AN(hmac); AN(hmac);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment