From: Nicholas Clark Date: Sat, 20 Nov 2004 14:21:28 +0000 (+0000) Subject: genuine possible buffer problems spotted by flawfinder X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=cf28e18a35edf50bf34f08788d10c879971e9922;p=p5sagit%2Fp5-mst-13.2.git genuine possible buffer problems spotted by flawfinder p4raw-id: //depot/perl@23520 --- diff --git a/regcomp.c b/regcomp.c index 7b4d647..bcfb2a3 100644 --- a/regcomp.c +++ b/regcomp.c @@ -5128,7 +5128,7 @@ Perl_save_re_context(pTHX) U32 i; GV *mgv; REGEXP *rx; - char digits[16]; + char digits[TYPE_CHARS(long)]; if (PL_curpm && (rx = PM_GETRE(PL_curpm))) { for (i = 1; i <= rx->nparens; i++) { diff --git a/util.c b/util.c index 9a90549..5a8ae3b 100644 --- a/util.c +++ b/util.c @@ -2539,7 +2539,7 @@ Perl_wait4pid(pTHX_ Pid_t pid, int *statusp, int flags) { SV *sv; SV** svp; - char spid[TYPE_CHARS(int)]; + char spid[TYPE_CHARS(IV)]; if (pid > 0) { sprintf(spid, "%"IVdf, (IV)pid); @@ -2555,9 +2555,6 @@ Perl_wait4pid(pTHX_ Pid_t pid, int *statusp, int flags) hv_iterinit(PL_pidstatus); if ((entry = hv_iternext(PL_pidstatus))) { - SV *sv; - char spid[TYPE_CHARS(int)]; - pid = atoi(hv_iterkey(entry,(I32*)statusp)); sv = hv_iterval(PL_pidstatus,entry); *statusp = SvIVX(sv); @@ -2606,7 +2603,7 @@ void Perl_pidgone(pTHX_ Pid_t pid, int status) { register SV *sv; - char spid[TYPE_CHARS(int)]; + char spid[TYPE_CHARS(IV)]; sprintf(spid, "%"IVdf, (IV)pid); sv = *hv_fetch(PL_pidstatus,spid,strlen(spid),TRUE);