From 945bd9a63198fe5b3341723648dde8a6ebcbe472 Mon Sep 17 00:00:00 2001 From: Lionel Sambuc Date: Tue, 19 Nov 2013 15:26:47 +0100 Subject: [PATCH] libc/sys-minix/mount.c: fix overflow Fix a bug where a filesystem label could overflow the reserved buffer. This was already possible with 32 bits values, but is more proeminent with dev_t being 64 bits. Change-Id: Idc04ed355d1dd92b7a8ce4699de832661a5c4ccd --- lib/libc/sys-minix/mount.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/sys-minix/mount.c b/lib/libc/sys-minix/mount.c index e9609f92b..f0ea0b8bf 100644 --- a/lib/libc/sys-minix/mount.c +++ b/lib/libc/sys-minix/mount.c @@ -86,7 +86,7 @@ int mountflags, srvflags; free(rslabel); } else { if (stat(name, &statbuf) < 0) return -1; - sprintf(label, "fs_%04x%llx", statbuf.st_dev, statbuf.st_ino); + sprintf(label, "fs_%llx_%llx", statbuf.st_dev, statbuf.st_ino); } } } else {