summaryrefslogtreecommitdiffstats
path: root/term-utils/script.c
diff options
context:
space:
mode:
authorRaphael S. Carvalho2014-10-09 02:46:07 +0200
committerKarel Zak2014-10-14 12:04:14 +0200
commit303884a4955db8b00d0eecf3b59a8c70895897b8 (patch)
treedaad33f00fdb536c25252fedea838cdaa9e1b6c4 /term-utils/script.c
parentbuild-sys: check for libtoolize rather than libtool (diff)
downloadkernel-qcow2-util-linux-303884a4955db8b00d0eecf3b59a8c70895897b8.tar.gz
kernel-qcow2-util-linux-303884a4955db8b00d0eecf3b59a8c70895897b8.tar.xz
kernel-qcow2-util-linux-303884a4955db8b00d0eecf3b59a8c70895897b8.zip
blkdiscard: fix underflow when offset is greater than device size
If offset (range[0]) is greater than device size (blksize), the variable 'end' will be greater than blksize, and range[1] (length) will be recalculated. The underflow happens when subtracting range[0] (offset) from blksize, thus range[1] will be the result of an underflow. The bug leads to unwanted behavior from the program, where range[1] is likely to be a high number and then will discard a considerable amount of blocks from the device. The fix consists of exitting the program with an error message when the condition stated above is true. Spotted while auditing the code. Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
Diffstat (limited to 'term-utils/script.c')
0 files changed, 0 insertions, 0 deletions