[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170728171243.23374-1-mka@chromium.org>
Date: Fri, 28 Jul 2017 10:12:43 -0700
From: Matthias Kaehlcke <mka@...omium.org>
To: Minchan Kim <minchan@...nel.org>, Nitin Gupta <ngupta@...are.org>,
Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
Cc: linux-kernel@...r.kernel.org,
Doug Anderson <dianders@...omium.org>,
Matthias Kaehlcke <mka@...omium.org>
Subject: [PATCH] zram: Fix buffer size passed to strlcpy()
comp_algorithm_store() passes the size of the source buffer to strlcpy()
instead of the destination buffer size, fix this.
Signed-off-by: Matthias Kaehlcke <mka@...omium.org>
---
drivers/block/zram/zram_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index 856d5dc02451..7d2ddffad361 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -327,7 +327,7 @@ static ssize_t comp_algorithm_store(struct device *dev,
return -EBUSY;
}
- strlcpy(zram->compressor, compressor, sizeof(compressor));
+ strlcpy(zram->compressor, compressor, sizeof(zram->compressor));
up_write(&zram->init_lock);
return len;
}
--
2.14.0.rc0.400.g1c36432dff-goog
Powered by blists - more mailing lists