Subject: | uninitialized comment struct crashes t/write.t |
Hi,
as seen in <http://bugs.debian.org/484046>, t/write.t dies after test 2
on the Debian PA-RISC (hppa) autobuilder.
The bug was introduced in 2.2, and it's not hppa specific, it just
happens to trigger only there for us. The
problem is that FLAC__metadata_object_vorbiscomment_append_comment()
is called with an uninitialized FLAC__StreamMetadata_VorbisComment_Entry
struct from Header.xs:639.
When the 'length' member happens to be non-zero,
FLAC__format_vorbiscomment_entry_is_legal() tries to dereference an
invalid pointer generating a segmentation fault.
Proposed patch attached, the module builds fine here with this.
Thanks for Audio-FLAC-Header,
--
Niko Tyni (Debian Perl Group)
ntyni@debian.org
Subject: | 484046.patch |
diff --git a/Header.xs b/Header.xs
index c15c0b5..4e7adcc 100644
--- a/Header.xs
+++ b/Header.xs
@@ -636,6 +636,7 @@ _write_XS(obj)
}
FLAC__StreamMetadata_VorbisComment_Entry entry;
+ entry.length = 0;
FLAC__metadata_object_vorbiscomment_append_comment(block, entry, /*copy=*/true);
if (hv_iterinit(tags)) {