]> Zhao Yanbai Git Server - minix.git/commitdiff
devmand: properly prevent overflow 82/2982/1
authorJacob Adams <Tookmund@users.noreply.github.com>
Sat, 4 Apr 2015 22:14:44 +0000 (18:14 -0400)
committerLionel Sambuc <lionel@minix3.org>
Wed, 15 Apr 2015 06:28:59 +0000 (08:28 +0200)
closes #22

Change-Id: Ia10f352a7ff5b05b1095dbb65d36316f9165a6f0

minix/commands/devmand/main.c

index 25cc0b8a8a8eee7bc314517c2d0067e320d65a45..14810fc64fdce03dc0410b46c41041e0843d94ac 100644 (file)
@@ -544,7 +544,7 @@ static enum dev_type determine_type (char *path)
                return DEV_TYPE_UNKOWN;
        }
 
-       res = fscanf(fd , "%256s\n", buf);
+       res = fscanf(fd , "%255s\n", buf);
        fclose(fd);
 
        if (res != 1) {