Subject: misc/33698: Crunchgen segfault (patch)
To: None <misc-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <hypnosses@pulltheplug.org>
List: netbsd-bugs
Date: 06/11/2006 04:25:00
>Number: 33698
>Category: misc
>Synopsis: Crunchgen segfault (patch)
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: misc-bug-people
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Sun Jun 11 04:25:00 +0000 2006
>Originator: Kevin Massey
>Release:
>Organization:
None
>Environment:
>Description:
>How-To-Repeat:
crunchgen `perl -e 'print "A" x 9999'`
>Fix:
Index: crunchgen.c
===================================================================
RCS file: /cvsroot/src/usr.bin/crunch/crunchgen/crunchgen.c,v
retrieving revision 1.69
diff -r1.69 crunchgen.c
163,166c163,166
< case 'm': strcpy(outmkname, optarg); break;
< case 'c': strcpy(outcfname, optarg); break;
< case 'e': strcpy(execfname, optarg); break;
< case 'd': strcpy(dbg, optarg); break;
---
> case 'm': strlcpy(outmkname, optarg, sizeof outmkname); break;
> case 'c': strlcpy(outcfname, optarg, sizeof outcfname); break;
> case 'e': strlcpy(execfname, optarg, sizeof execfname); break;
> case 'd': strlcpy(dbg, optarg, sizeof dbg); break;
168,169c168,169
< case 'D': strcpy(topdir, optarg); break;
< case 'L': strcpy(libdir, optarg); break;
---
> case 'D': strlcpy(topdir, optarg, sizeof topdir); break;
> case 'L': strlcpy(libdir, optarg, sizeof libdir); break;
187c187
< strcpy(infilename, argv[0]);
---
> strlcpy(infilename, argv[0], sizeof infilename);
193c193
< strcpy(confname, p + 1);
---
> strlcpy(confname, p + 1, sizeof confname);
195c195
< strcpy(confname, infilename);
---
> strlcpy(confname, infilename, sizeof confname);
272c272
< strcpy(curfilename, filename);
---
> strlcpy(curfilename, filename, sizeof curfilename);
349c349
< strcpy(tmppath, argv[i]);
---
> strlcpy(tmppath, argv[i], sizeof tmppath);
352c352
< strcpy(tmppath, curdir);
---
> strlcpy(tmppath, curdir, sizeof tmppath);
354c354
< strcpy(tmppath, topdir);
---
> strlcpy(tmppath, topdir, sizeof tmppath);
469c469
< strcpy(tmppath, curdir);
---
> strlcpy(tmppath, curdir, sizeof tmppath);
471c471
< strcpy(tmppath, topdir);
---
> strlcpy(tmppath, topdir, sizeof tmppath);
602c602
< strcpy(tmppath, curdir);
---
> strlcpy(tmppath, curdir, sizeof tmppath);
604c604
< strcpy(tmppath, topdir);
---
> strlcpy(tmppath, topdir, sizeof tmppath);