From: Jacob Adams Date: Wed, 18 Mar 2015 00:40:49 +0000 (-0400) Subject: Do not read past the end of the buffer X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zpipe.c?a=commitdiff_plain;h=271999a2f3d77db5f22eaa05707a591dfe1294f6;p=minix.git Do not read past the end of the buffer closes #22 Change-Id: I239c670915d98440c176ccf23e5270c40c4fbe81 --- diff --git a/minix/commands/devmand/main.c b/minix/commands/devmand/main.c index 8d9b1efd1..25cc0b8a8 100644 --- a/minix/commands/devmand/main.c +++ b/minix/commands/devmand/main.c @@ -544,7 +544,7 @@ static enum dev_type determine_type (char *path) return DEV_TYPE_UNKOWN; } - res = fscanf(fd , "%s\n", buf); + res = fscanf(fd , "%256s\n", buf); fclose(fd); if (res != 1) {