From owner-freebsd-ports Tue Nov 12 16:10: 9 2002 Delivered-To: freebsd-ports@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 37DAE37B401 for ; Tue, 12 Nov 2002 16:10:07 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8A45F43E42 for ; Tue, 12 Nov 2002 16:10:06 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id gAD0A5x3097034 for ; Tue, 12 Nov 2002 16:10:05 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id gAD0A5Qt097033; Tue, 12 Nov 2002 16:10:05 -0800 (PST) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 82E8537B406; Tue, 12 Nov 2002 16:07:09 -0800 (PST) Received: from cell.sick.ru (cell.sick.ru [195.91.162.238]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8BA9943E6E; Tue, 12 Nov 2002 16:07:08 -0800 (PST) (envelope-from glebius@cell.sick.ru) Received: from cell.sick.ru (glebius@localhost [127.0.0.1]) by cell.sick.ru (8.12.6/8.12.6) with ESMTP id gAD075ns014785 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Wed, 13 Nov 2002 03:07:06 +0300 (MSK) (envelope-from glebius@cell.sick.ru) Received: (from glebius@localhost) by cell.sick.ru (8.12.6/8.12.6/Submit) id gAD074nd014784; Wed, 13 Nov 2002 03:07:04 +0300 (MSK) Message-Id: <200211130007.gAD074nd014784@cell.sick.ru> Date: Wed, 13 Nov 2002 03:07:04 +0300 (MSK) From: Gleb Smirnoff Reply-To: Gleb Smirnoff To: FreeBSD-gnats-submit@FreeBSD.org Cc: des@FreeBSD.org, hippm@informatik.uni-tuebingen.de X-Send-Pr-Version: 3.113 Subject: ports/45252: mpg123 dumps core when $TERM is not set Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 45252 >Category: ports >Synopsis: mpg123 dumps core when $TERM is not set >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Nov 12 16:10:05 PST 2002 >Closed-Date: >Last-Modified: >Originator: Gleb Smirnoff >Release: FreeBSD 4.7-PRERELEASE i386 >Organization: Moscow State University >Environment: System: FreeBSD cell.sick.ru 4.7-PRERELEASE FreeBSD 4.7-PRERELEASE #7: Fri Sep 6 02:58:47 MSD 2002 root@cell.sick.ru:/usr/obj/usr/src/sys/NUCLEUS i386 >Description: When mpg123 installed from fresh FreeBSD ports is run, and environment variable TERM is not set it dumps core. For example mpg123 can be run from atrun(8) or cron(8) to act as an alarm. >How-To-Repeat: unset TERM mpg123 /some/file.mp3 >Fix: The problem is that value taken from getenv() is not checked and passed to strcmp(). Patch for FreeBSD ports (must be applied after all other port's patches) follows: --- mpg123.c Wed Nov 13 02:52:54 2002 +++ /tmp/mpg123.c Wed Nov 13 02:53:41 2002 @@ -934,10 +934,10 @@ #if !defined(GENERIC) { - const char *term_type; - term_type = getenv("TERM"); - if (!strcmp(term_type,"xterm")) - { + const char *term_type; + + if (((term_type = getenv("TERM")) != NULL) + && (!strcmp(term_type,"xterm"))) { fprintf(stderr, "\033]0;%s\007", filename); } } >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message