]> Zhao Yanbai Git Server - minix.git/commitdiff
Do not read past the end of the buffer 62/2962/1
authorJacob Adams <tookmund@gmail.com>
Wed, 18 Mar 2015 00:40:49 +0000 (20:40 -0400)
committerLionel Sambuc <lionel@minix3.org>
Wed, 18 Mar 2015 07:29:46 +0000 (08:29 +0100)
closes #22

Change-Id: I239c670915d98440c176ccf23e5270c40c4fbe81

minix/commands/devmand/main.c

index 8d9b1efd1b59916dc51497557d21f19e5e1d8916..25cc0b8a8a8eee7bc314517c2d0067e320d65a45 100644 (file)
@@ -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) {