From owner-freebsd-bugs@FreeBSD.ORG Fri Feb 4 16:30:19 2005 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E980016A4CE for ; Fri, 4 Feb 2005 16:30:18 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id B66D843D39 for ; Fri, 4 Feb 2005 16:30:18 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.1/8.13.1) with ESMTP id j14GUISk094020 for ; Fri, 4 Feb 2005 16:30:18 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.1/8.13.1/Submit) id j14GUIsA094017; Fri, 4 Feb 2005 16:30:18 GMT (envelope-from gnats) Resent-Date: Fri, 4 Feb 2005 16:30:18 GMT Resent-Message-Id: <200502041630.j14GUIsA094017@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Martin Birgmeier Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 66D5116A4CE for ; Fri, 4 Feb 2005 16:30:12 +0000 (GMT) Received: from email.aon.at (warsl404pip7.highway.telekom.at [195.3.96.91]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2EE2843D46 for ; Fri, 4 Feb 2005 16:30:11 +0000 (GMT) (envelope-from martin@email.aon.at) Received: (qmail 4656 invoked from network); 4 Feb 2005 16:30:09 -0000 Received: from m024p002.adsl.highway.telekom.at (HELO gandalf.xyzzy) ([62.47.170.226]) (envelope-sender ) by smarthub02.highway.telekom.at (qmail-ldap-1.03) with SMTP for ; 4 Feb 2005 16:30:09 -0000 Received: from gandalf.xyzzy (localhost.xyzzy [127.0.0.1]) by gandalf.xyzzy (8.12.11/8.12.11) with ESMTP id j14GU8W5001635 for ; Fri, 4 Feb 2005 17:30:08 +0100 (CET) (envelope-from martin@gandalf.xyzzy) Received: (from martin@localhost) by gandalf.xyzzy (8.12.11/8.12.11/Submit) id j14GU78R001634; Fri, 4 Feb 2005 17:30:07 +0100 (CET) (envelope-from martin) Message-Id: <200502041630.j14GU78R001634@gandalf.xyzzy> Date: Fri, 4 Feb 2005 17:30:07 +0100 (CET) From: Martin Birgmeier To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/77104: [patch] fixes to ppp dumping core when doing log/command substitutions X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Martin Birgmeier List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Feb 2005 16:30:19 -0000 >Number: 77104 >Category: bin >Synopsis: [patch] fixes to ppp dumping core when doing log/command substitutions >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Feb 04 16:30:17 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Martin Birgmeier >Release: FreeBSD 4.10-RELEASE i386 >Organization: MBi at home >Environment: System: FreeBSD gandalf.xyzzy 4.10-RELEASE FreeBSD 4.10-RELEASE #0: Sun Jul 4 12:28:27 CEST 2004 root@gandalf.xyzzy:/d/6s4e/OBJ/FreeBSD/RELENG_4_10_0_RELEASE/src/sys/GANDALF i386 >Description: User ppp dumps core when using log substitutions In spite of what whoever is writing in http://www.freebsd.org/cgi/query-pr.cgi?pr=59995 at Mon Oct 11 11:16:04 GMT 2004, the problem still persists, and the fix given there (and repeated here) for command.c is still valid and necessary for RELENG_4, RELENG_5, and HEAD. Hint: The reason why the fix is correct lies in the following line from command.c: ntgt = realloc(tgt, ltgt += lnewstr - loldstr); Just think about it! >How-To-Repeat: Start ppp; use logfile (or command) substitutions which expand the string (e.g., "HISADDR", which would be expanded to a string like "192.168.55.245") >Fix: *** usr.sbin/ppp/command.c.ORIG Sat Dec 6 21:31:04 2003 --- usr.sbin/ppp/command.c Sat Dec 6 21:32:06 2003 *************** *** 452,458 **** tgt = ntgt; } if (lnewstr > loldstr) ! bcopy(word + loldstr, word + lnewstr, ltgt - pos - loldstr); bcopy(newstr, word, lnewstr); } while ((word = strstrword(word, oldstr))); --- 452,458 ---- tgt = ntgt; } if (lnewstr > loldstr) ! bcopy(word + loldstr, word + lnewstr, ltgt - pos - lnewstr); bcopy(newstr, word, lnewstr); } while ((word = strstrword(word, oldstr))); -- Martin Birgmeier Vienna Austria >Release-Note: >Audit-Trail: >Unformatted: