Преглед на файлове

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
Will Huang преди 6 години
родител
ревизия
5a7391c0c1
променени са 1 файла, в които са добавени 4 реда и са изтрити 2 реда
  1. 4 2
      core/sme/src/csr/csr_util.c

+ 4 - 2
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;