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
This commit is contained in:
parent
4b90625c2f
commit
4c1f3a3fa5
|
|
@ -39,7 +39,7 @@ int mountflags, srvflags;
|
||||||
int r;
|
int r;
|
||||||
message m;
|
message m;
|
||||||
struct stat statbuf;
|
struct stat statbuf;
|
||||||
char label[16];
|
char label[36];
|
||||||
char path[PATH_MAX];
|
char path[PATH_MAX];
|
||||||
char cmd[200];
|
char cmd[200];
|
||||||
char *p;
|
char *p;
|
||||||
|
|
@ -86,7 +86,7 @@ int mountflags, srvflags;
|
||||||
free(rslabel);
|
free(rslabel);
|
||||||
} else {
|
} else {
|
||||||
if (stat(name, &statbuf) < 0) return -1;
|
if (stat(name, &statbuf) < 0) return -1;
|
||||||
sprintf(label, "fs_%04x%llx", statbuf.st_dev, statbuf.st_ino);
|
sprintf(label, "fs_%04llx%08llx", statbuf.st_dev, statbuf.st_ino);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user