Unverified Commit 50ac61bf authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!10401 firmware: cs_dsp: Use strnlen() on name fields in V1 wmfw files

parents fe0b65c7 3dad3b27
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1109,7 +1109,7 @@ static inline void cs_dsp_coeff_parse_alg(struct cs_dsp *dsp, const u8 **data,

		blk->id = le32_to_cpu(raw->id);
		blk->name = raw->name;
		blk->name_len = strlen(raw->name);
		blk->name_len = strnlen(raw->name, ARRAY_SIZE(raw->name));
		blk->ncoeff = le32_to_cpu(raw->ncoeff);
		break;
	default:
@@ -1142,7 +1142,7 @@ static inline void cs_dsp_coeff_parse_coeff(struct cs_dsp *dsp, const u8 **data,
		blk->offset = le16_to_cpu(raw->hdr.offset);
		blk->mem_type = le16_to_cpu(raw->hdr.type);
		blk->name = raw->name;
		blk->name_len = strlen(raw->name);
		blk->name_len = strnlen(raw->name, ARRAY_SIZE(raw->name));
		blk->ctl_type = le16_to_cpu(raw->ctl_type);
		blk->flags = le16_to_cpu(raw->flags);
		blk->len = le32_to_cpu(raw->len);