Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pullup ticket 268 - requested by Johnny C. Lam
security fix fod perl58 Patch provided by the submitter. PKGREVISION bumped. Fixes for: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2005-0155 http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2005-0156
- Loading branch information
salo
committed
Feb 5, 2005
1 parent
233e458
commit 8b19e2c
Showing
3 changed files
with
28 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
$NetBSD: patch-bf,v 1.1.2.2 2005/02/05 17:22:21 salo Exp $ | ||
|
||
--- perlio.c.orig 2004-09-10 03:06:52.000000000 -0400 | ||
+++ perlio.c | ||
@@ -448,7 +448,8 @@ PerlIO_debug(const char *fmt, ...) | ||
va_list ap; | ||
dSYS; | ||
va_start(ap, fmt); | ||
- if (!dbg) { | ||
+ /* Tighten uid/gid checks [CAN-2005-0155] */ | ||
+ if (!dbg && !PL_tainting && PL_uid == PL_euid && PL_gid == PL_egid) { | ||
char *s = PerlEnv_getenv("PERLIO_DEBUG"); | ||
if (s && *s) | ||
dbg = PerlLIO_open3(s, O_WRONLY | O_CREAT | O_APPEND, 0666); | ||
@@ -465,7 +466,8 @@ PerlIO_debug(const char *fmt, ...) | ||
s = CopFILE(PL_curcop); | ||
if (!s) | ||
s = "(none)"; | ||
- sprintf(buffer, "%s:%" IVdf " ", s, (IV) CopLINE(PL_curcop)); | ||
+ /* Avoid PERLIO_DEBUG buffer overflow [CAN-2005-0156] */ | ||
+ sprintf(buffer, "%.40s:%" IVdf " ", s, (IV) CopLINE(PL_curcop)); | ||
len = strlen(buffer); | ||
vsprintf(buffer+len, fmt, ap); | ||
PerlLIO_write(dbg, buffer, strlen(buffer)); |