]> git.karo-electronics.de Git - karo-tx-linux.git/commit
kvm tools: Avoid overflow
authorLai Jiangshan <laijs@cn.fujitsu.com>
Tue, 20 Dec 2011 09:08:41 +0000 (17:08 +0800)
committerPekka Enberg <penberg@kernel.org>
Wed, 21 Dec 2011 20:28:07 +0000 (22:28 +0200)
commita82c229f55b100c38692dc869df6e2faec84b960
treed94f8c0497b5204ee46d4bb8b990750685dd0bae
parentc17523f705ca3e790946ba8b9d17fd7a762c2c3b
kvm tools: Avoid overflow

"entry.d_name[strlen(entry.d_name)-5] = 0" may overflow
when strlen(entry.d_name) < 5.

also avoid magic number(5).

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
tools/kvm/kvm.c