Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Nov 2002 03:07:04 +0300 (MSK)
From:      Gleb Smirnoff <glebius@cell.sick.ru>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        des@FreeBSD.org, hippm@informatik.uni-tuebingen.de
Subject:   ports/45252: mpg123 dumps core when $TERM is not set
Message-ID:  <200211130007.gAD074nd014784@cell.sick.ru>

next in thread | raw e-mail | index | archive | help

>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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200211130007.gAD074nd014784>