lib/krb5_wrap: clang: Fix warning: Null pointer passed as an argument
authorNoel Power <noel.power@suse.com>
Tue, 18 Jun 2019 10:47:29 +0000 (10:47 +0000)
committerNoel Power <npower@samba.org>
Mon, 1 Jul 2019 13:34:11 +0000 (13:34 +0000)
Fixes:

lib/krb5_wrap/krb5_samba.c:3241:3: warning: Null pointer passed as an argument to a 'nonnull' parameter <--[clang]
                memcpy(gss_cksum + 28, in_data->data, orig_length);
                ^

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
lib/krb5_wrap/krb5_samba.c

index eac86e6..37257dd 100644 (file)
@@ -3234,7 +3234,7 @@ static krb5_error_code ads_create_gss_checksum(krb5_data *in_data, /* [inout] */
 
        SIVAL(gss_cksum, 20, gss_flags);
 
-       if (orig_length) {
+       if (orig_length && in_data->data != NULL) {
                SSVAL(gss_cksum, 24, 1); /* The Delegation Option identifier */
                SSVAL(gss_cksum, 26, orig_length);
                /* Copy the kerberos KRB_CRED data */