From 9def3f9efec2e8b24b1a0b6d447f451ebc73ff53 Mon Sep 17 00:00:00 2001 From: Jacob Adams Date: Tue, 17 Mar 2015 20:40:49 -0400 Subject: [PATCH] Do not read past the end of the buffer --- minix/commands/devmand/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) {