Currently variables "i" and "k" in config_filename_next() function may increase at the same speed. When repeating "for" loop at line 1862 both "i" and "k" are being incremented: + i by the for loop, + k by the "out[k++]" instruction. This means that there may be a case, where for loop ends with "i < BDEVPERF_CONFIG_MAX_FILENAME" condition, as value of "i" is equal to BDEVPERF_CONFIG_MAX_FILENAME, and at the same time value of "k" is also equal to BDEVPERF_CONFIG_MAX_FILENAME, because after writing to out[BDEVPERF_CONFIG_MAX_FILENAME - 1] element, we increment it one last time. This results in writing "0" value at line 1873 to memory outside "out" array boundary. To amend this problem, compare k against BDEVPERF_CONFIG_MAX_FILENAME, insted of i. Change-Id: Ia45778c1f267d2b9dcd676cd9b6c662d09f6f94e Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17176 Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> |
||
---|---|---|
.. | ||
accel | ||
bdev | ||
blob | ||
idxd | ||
interrupt_tgt | ||
ioat | ||
nvme | ||
nvmf | ||
sock | ||
util | ||
vmd | ||
Makefile |