From 5a7391c0c1a6717484d4c0905baad69553c2ecfa Mon Sep 17 00:00:00 2001 From: Will Huang Date: Mon, 1 Apr 2019 14:27:10 +0800 Subject: [PATCH] qcacld-3.0: Add NULL pointer check before de-reference If csr_is_security_match() call csr_validate_any_default(), it passed NULL pointers of some input parameters, check these pointers before de-reference it. Change-Id: I2cbd9f680c8a90919599db3af5b522ccb760892d CRs-Fixed: 2423713 --- core/sme/src/csr/csr_util.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/sme/src/csr/csr_util.c b/core/sme/src/csr/csr_util.c index c369e708a412..dd1cd2ca7e46 100644 --- a/core/sme/src/csr/csr_util.c +++ b/core/sme/src/csr/csr_util.c @@ -5251,8 +5251,10 @@ static bool csr_validate_any_default(struct mac_context *mac_ctx, return match; } - *neg_auth_type = eCSR_AUTH_TYPE_OPEN_SYSTEM; - *mc_cipher = eCSR_ENCRYPT_TYPE_NONE; + if (neg_auth_type) + *neg_auth_type = eCSR_AUTH_TYPE_OPEN_SYSTEM; + if (mc_cipher) + *mc_cipher = eCSR_ENCRYPT_TYPE_NONE; *uc_cipher = eCSR_ENCRYPT_TYPE_NONE; return match;