Skip to content

Commit

Permalink
libcdio: fix crash reading CD TOC
Browse files Browse the repository at this point in the history
Remove the unnecessary byte added to the TOC buffer.
See the upstream patch: https://git.savannah.gnu.org/cgit/libcdio.git/commit/?id=6f2426e8bf4dc5269ccbd9fbfa94340895f8be6e
  • Loading branch information
jmon12 authored and reneeotten committed Feb 28, 2024
1 parent dae9080 commit ff7dcd7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions devel/libcdio/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ PortSystem 1.0

name libcdio
version 2.1.0
revision 1

categories devel
license GPL-3+
Expand Down Expand Up @@ -33,6 +34,9 @@ checksums rmd160 6b0e4917cd2dd5cac0b7afdb70789bf0ad2aed79 \
# doesn't understand the pramga usage in the Tiger headers - gcc bug 50909
patchfiles patch-libcdio-lib-iso9660-move-pragma.diff

# Remove the unecessary addtional byte added to the TOC buffer
patchfiles-append remove-additional-byte-TOC-buffer.diff

configure.args --disable-rpath \
--disable-silent-rules

Expand Down
12 changes: 12 additions & 0 deletions devel/libcdio/files/remove-additional-byte-TOC-buffer.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Upstream patch: https://git.savannah.gnu.org/cgit/libcdio.git/commit/?id=6f2426e8bf4dc5269ccbd9fbfa94340895f8be6e
--- lib/driver/osx.c.orig
+++ lib/driver/osx.c
@@ -1232,7 +1232,7 @@
CFRange range;
CFIndex buf_len;

- buf_len = CFDataGetLength( data ) + 1;
+ buf_len = CFDataGetLength( data );
range = CFRangeMake( 0, buf_len );

if( ( p_env->pTOC = (CDTOC *)malloc( buf_len ) ) != NULL ) {

0 comments on commit ff7dcd7

Please sign in to comment.