From owner-freebsd-ports-bugs@FreeBSD.ORG Sat Jul 19 23:00:07 2008 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 422351065690 for ; Sat, 19 Jul 2008 23:00:07 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 2F7818FC34 for ; Sat, 19 Jul 2008 23:00:07 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m6JN0682074239 for ; Sat, 19 Jul 2008 23:00:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m6JN06P3074238; Sat, 19 Jul 2008 23:00:06 GMT (envelope-from gnats) Resent-Date: Sat, 19 Jul 2008 23:00:06 GMT Resent-Message-Id: <200807192300.m6JN06P3074238@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "Pedro F. Giffuni" Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0CADC1065672 for ; Sat, 19 Jul 2008 22:53:47 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 0B73F8FC08 for ; Sat, 19 Jul 2008 22:53:47 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m6JMrkVH099071 for ; Sat, 19 Jul 2008 22:53:46 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.2/8.14.1/Submit) id m6JMrk89099064; Sat, 19 Jul 2008 22:53:46 GMT (envelope-from nobody) Message-Id: <200807192253.m6JMrk89099064@www.freebsd.org> Date: Sat, 19 Jul 2008 22:53:46 GMT From: "Pedro F. Giffuni" To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/125787: print/nenscript prevent buffer overflow X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2008 23:00:07 -0000 >Number: 125787 >Category: ports >Synopsis: print/nenscript prevent buffer overflow >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sat Jul 19 23:00:06 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Pedro F. Giffuni >Release: 6.3-Release >Organization: >Environment: FreeBSD kakumen.cable.net.co 6.3-RELEASE FreeBSD 6.3-RELEASE #10: Sat Jan 19 01: 13:55 COT 2008 root@kakumen.cable.net.co:/usr/src/sys/amd64/compile/SMP amd 64 >Description: Minimal patch to prevent a buffer overflow. Really minimal, it's not exploitable. >How-To-Repeat: Found casually running security/flawfinder >Fix: diff -ruN nenscript.orig/files/patch-main.c nenscript/files/patch-main.c --- nenscript.orig/files/patch-main.c 1969-12-31 19:00:00.000000000 -0500 +++ nenscript/files/patch-main.c 2008-07-19 14:34:43.000000000 -0500 @@ -0,0 +1,11 @@ +--- main.c.orig 2008-07-19 14:32:26.000000000 -0500 ++++ main.c 2008-07-19 14:34:12.000000000 -0500 +@@ -601,7 +601,7 @@ + exit (1); + } + #else +- sprintf (cmd, "%s %s", LPR, printername); ++ snprintf (cmd, sizeof(cmd), "%s %s", LPR, printername); + if ((outputstream = popen (cmd, "w")) == NULL) { + perror (LPR); + exit (1); >Release-Note: >Audit-Trail: >Unformatted: