projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6fb4e48
)
Fix buffer overflows noted by Gerardo Puga
author
Eric Andersen
<andersen@codepoet.org>
Thu, 6 Jun 2002 14:36:07 +0000
(14:36 -0000)
committer
Eric Andersen
<andersen@codepoet.org>
Thu, 6 Jun 2002 14:36:07 +0000
(14:36 -0000)
-Erik
miscutils/makedevs.c
patch
|
blob
|
history
diff --git
a/miscutils/makedevs.c
b/miscutils/makedevs.c
index 4e50a6d718f443d0ec5795ee9124fcf042fcbd8e..f559956852b1f0e1cc651ebf93d0c908125c2588 100644
(file)
--- a/
miscutils/makedevs.c
+++ b/
miscutils/makedevs.c
@@
-52,9
+52,13
@@
int makedevs_main(int argc, char **argv)
if (type[0] != 'f')
dev = (major << 8) | Sminor;
- s
trcpy(devname, basedev
);
+ s
afe_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 {