Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7c7c3201 authored by Rongjing Liao's avatar Rongjing Liao Committed by nshrivas
Browse files

qcacmn: add argument '_len' sanity check before use

When argument '_len' is equal to 0 or less than 0, 'ascii'
array element will be used uninitialized. To fix this case,
add arguemnt sanity check before use.

Change-Id: I2e2a4c199fac72466f831bb4261a6a03ac116e11
CRs-Fixed: 2643354
parent cfb51283
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -75,6 +75,11 @@ static inline void target_if_spectral_hexdump(unsigned char *_buf, int _len)

	qdf_mem_zero(hexdump_line, sizeof(hexdump_line));

	if (_len <= 0) {
		spectral_err("buffer len is %d, too short", _len);
		return;
	}

	for (i = 0; i < _len; i++) {
		mod = i % SPECTRAL_HEXDUMP_NUM_OCTETS_PER_LINE;