From: Jens Axboe Date: Wed, 9 Apr 2014 03:15:09 +0000 (-0600) Subject: diskutil: fix potential out-of-bounds array write X-Git-Tag: fio-2.1.8~5^2~1 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=976406b8a0d823f053400178b7b86f32a973762d;ds=sidebyside diskutil: fix potential out-of-bounds array write Signed-off-by: Jens Axboe --- diff --git a/diskutil.c b/diskutil.c index 9aa1fa15..cbde42e9 100644 --- a/diskutil.c +++ b/diskutil.c @@ -236,7 +236,7 @@ static void find_add_disk_slaves(struct thread_data *td, char *path, * are links to the real directories for the slave * devices? */ - linklen = readlink(temppath, slavepath, PATH_MAX - 0); + linklen = readlink(temppath, slavepath, PATH_MAX - 1); if (linklen < 0) { perror("readlink() for slave device."); return;