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
This commit is contained in:
parent
a8ebcb1bc0
commit
0d4d06c9d7
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=164522
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user