diff options
author | maxim <maxim@FreeBSD.org> | 2006-11-22 21:05:17 +0000 |
---|---|---|
committer | maxim <maxim@FreeBSD.org> | 2006-11-22 21:05:17 +0000 |
commit | df4984d2dda3f456594a1a5bd9d22c3acfd1a968 (patch) | |
tree | 836125e939843eb98c0a1d55595de9569ef604f4 /usr.bin/banner | |
parent | 74662be6c0d18bb0418dc721a9c34f28d437c478 (diff) | |
download | FreeBSD-src-df4984d2dda3f456594a1a5bd9d22c3acfd1a968.zip FreeBSD-src-df4984d2dda3f456594a1a5bd9d22c3acfd1a968.tar.gz |
o Check that -w width is not above maximum. Use DWIDTH instead of
hardcoded constant.
Reported by: Gruzicki Wlodek on BugTraq
Obtained from: NetBSD, OpenBSD
MFC after: 1 week
Diffstat (limited to 'usr.bin/banner')
-rw-r--r-- | usr.bin/banner/banner.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/banner/banner.c b/usr.bin/banner/banner.c index 99914e0..eb96a15 100644 --- a/usr.bin/banner/banner.c +++ b/usr.bin/banner/banner.c @@ -1045,7 +1045,7 @@ main(int argc, char *argv[]) break; case 'w': width = atoi(optarg); - if (width <= 0) + if (width <= 0 || width > DWIDTH) errx(1, "illegal argument for -w option"); break; case '?': @@ -1056,7 +1056,7 @@ main(int argc, char *argv[]) argv += optind; for (i = 0; i < width; i++) { - j = i * 132 / width; + j = i * DWIDTH / width; print[j] = 1; } |