Unverified Commit 614fb0ae authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!7749 v2 wifi: iwlwifi: dbg-tlv: ensure NUL termination

parents 61eae68f c66ac778
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -155,6 +155,12 @@ static int iwl_dbg_tlv_alloc_debug_info(struct iwl_trans *trans,
	if (le32_to_cpu(tlv->length) != sizeof(*debug_info))
		return -EINVAL;

	/* we use this as a string, ensure input was NUL terminated */
	if (strnlen(debug_info->debug_cfg_name,
		    sizeof(debug_info->debug_cfg_name)) ==
			sizeof(debug_info->debug_cfg_name))
		return -EINVAL;

	IWL_DEBUG_FW(trans, "WRT: Loading debug cfg: %s\n",
		     debug_info->debug_cfg_name);