]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Add NegoEx assertion to squash defect
authorGreg Hudson <ghudson@mit.edu>
Mon, 9 Dec 2019 16:42:47 +0000 (11:42 -0500)
committerGreg Hudson <ghudson@mit.edu>
Sun, 5 Jan 2020 06:16:36 +0000 (01:16 -0500)
Coverity sees negoex_init() test whether input_token is null before
parsing messages, then dereference input_token in verify_checksum().
Of course verify_checksum() will not find a checksum message if no
messages were parsed.  Add an assert to squash the false positive
forward-null defect.

src/lib/gssapi/spnego/negoex_ctx.c

index e69b7200e3af7d35e876dfd3718c2146de0d7e03..18d9d4147de2aa497423bc3cf83256c7b9321899 100644 (file)
@@ -454,6 +454,7 @@ verify_checksum(OM_uint32 *minor, spnego_gss_ctx_id_t ctx,
 
     /* Verify the checksum over the existing transcript and the portion of the
      * input token leading up to the verify message. */
+    assert(input_token != NULL);
     iov[0].flags = KRB5_CRYPTO_TYPE_DATA;
     iov[0].data = make_data(ctx->negoex_transcript.data,
                             ctx->negoex_transcript.len);