Subject: Bug#101735: mp3blaster: [patch] fix segfault on vt100 terminals

From: Bernhard Fischer <[email-masked]>
Date: Sun, 9 Jan 2005 14:20:17 +0100

Package: mp3blaster
Version: 1:3.2.0-6
Followup-For: Bug #101735

is_audiofile() segfaults in strcmp when passing in a null pointer.
Attached patch tests for null. Note that this does not fix handling
the function-keys on vt100 proper.

-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.6.8-p4-smp
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages mp3blaster depends on:
ii  libc6                       2.3.2.ds1-20 GNU C Library: Shared libraries an
ii  libgcc1                     1:3.4.3-6    GCC support library
ii  libncurses5                 5.4-4        Shared libraries for terminal hand
ii  libsidplay1-c102            1.36.59-2    SID (MOS 6581) emulation library
ii  libstdc++5                  1:3.3.5-5    The GNU Standard C++ Library v3
ii  libvorbis0a                 1.0.1-1      The Vorbis General Audio Compressi
ii  libvorbisfile3              1.0.1-1      The Vorbis General Audio Compressi

-- no debconf information
diff -X /usr/src/excl -rup mp3blaster-3.2.0.oorig/src/main.cc mp3blaster-3.2.0/src/main.cc
--- mp3blaster-3.2.0.oorig/src/main.cc	2003-09-09 23:22:55.000000000 +0200
+++ mp3blaster-3.2.0/src/main.cc	2004-12-12 14:44:59.000000000 +0100
@@ -3413,7 +3423,8 @@ handle_input(short no_delay)
 			}
 
 			/* Also mark file as bad? */
-			if (cmd == CMD_DEL_MARK && is_audiofile(sw->getSelectedItem()))
+			if (cmd == CMD_DEL_MARK && sw->getSelectedItem() != NULL
+					&& is_audiofile(sw->getSelectedItem()))
 				fw_markfilebad(sw->getSelectedItem());
 
 			sw->delItem(sw->sw_selection);