From 976406b8a0d823f053400178b7b86f32a973762d Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 8 Apr 2014 21:15:09 -0600 Subject: [PATCH] diskutil: fix potential out-of-bounds array write Signed-off-by: Jens Axboe --- diskutil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.25.1