Bug#479580: libaudio-flac-header-perl: new() segfaults when the flac is missing a VENDOR tag

David Caldwell david at porkrind.org
Mon May 5 14:58:23 UTC 2008


Package: libaudio-flac-header-perl
Version: 2.0-1david2
Severity: important
Tags: patch


My test is this:

  perl -MAudio::FLAC::Header -e '$flac=Audio::FLAC::Header->new("test.flac");'

This will give me a segmentation fault when the flac file has no VENDOR tag.

Attached is a patch that fixes the problem.

Thanks,
  David

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.24-1-686 (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash

Versions of packages libaudio-flac-header-perl depends on:
ii  libc6                         2.7-10     GNU C Library: Shared libraries
ii  libflac8                      1.2.1-1.2  Free Lossless Audio Codec - runtim
ii  perl                          5.8.8-12   Larry Wall's Practical Extraction 
ii  perl-base [perlapi-5.8.8]     5.8.8-12   The Pathologically Eclectic Rubbis

libaudio-flac-header-perl recommends no packages.

-- no debconf information
-------------- next part --------------
Index: libaudio-flac-header-perl-2.0/Header.xs
===================================================================
--- libaudio-flac-header-perl-2.0.orig/Header.xs	2008-05-05 07:49:50.000000000 -0700
+++ libaudio-flac-header-perl-2.0/Header.xs	2008-05-05 07:50:39.000000000 -0700
@@ -155,7 +155,8 @@
 			AV   *rawTagArray = newAV();
 			HV   *tags = newHV();
 
-			my_hv_store(tags, "VENDOR", newSVpv((char*)block->data.vorbis_comment.vendor_string.entry, 0));
+			if (block->data.vorbis_comment.vendor_string.entry)
+				my_hv_store(tags, "VENDOR", newSVpv((char*)block->data.vorbis_comment.vendor_string.entry, 0));
 
 			for (i = 0; i < block->data.vorbis_comment.num_comments; i++) {
 


More information about the pkg-perl-maintainers mailing list