Fix buffer overflows noted by Gerardo Puga
-Erik
This commit is contained in:
parent
6fb4e4877a
commit
fe1ef2bc62
@ -52,9 +52,13 @@ int makedevs_main(int argc, char **argv)
|
||||
|
||||
if (type[0] != 'f')
|
||||
dev = (major << 8) | Sminor;
|
||||
strcpy(devname, basedev);
|
||||
safe_strncpy(devname, basedev, sizeof(devname));
|
||||
|
||||
if (sbase == 0) {
|
||||
int len;
|
||||
len = strlen(devname);
|
||||
if (S > 10000 || len > (sizeof(devname)-6))
|
||||
error_msg_and_die("%s: number too large", buf);
|
||||
sprintf(buf, "%d", S);
|
||||
strcat(devname, buf);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user