[SCM] libaacs/master: Fix segfaults when mount point patch cannot be resolved.

alessio at users.alioth.debian.org alessio at users.alioth.debian.org
Thu Jan 12 18:26:05 UTC 2012


The following commit has been merged in the master branch:
commit 52fa8bd5aa55bd2f54d768eb5d1addb6380c057b
Author: Alessio Treglia <alessio at debian.org>
Date:   Thu Jan 12 19:25:13 2012 +0100

    Fix segfaults when mount point patch cannot be resolved.
    
    - The fix works on Linux only, since non-Linux archs still rely on the old code (cause of PATH_MAX).

diff --git a/debian/patches/0002-unresolved_mount_point.patch b/debian/patches/0002-unresolved_mount_point.patch
new file mode 100644
index 0000000..5cab20a
--- /dev/null
+++ b/debian/patches/0002-unresolved_mount_point.patch
@@ -0,0 +1,53 @@
+Description: Fix segfaults when mount point patch cannot be resolved.
+ The fix works on Linux, since non-Linux archs still rely on the old
+ code.
+Origin: http://git.videolan.org/?p=libaacs.git;a=commitdiff;h=556699544
+Reviewed-by: Alessio Treglia <alessio at debian.org>
+---
+ configure.ac      |    2 +-
+ src/libaacs/mmc.c |   14 ++++++++++++++
+ 2 files changed, 15 insertions(+), 1 deletion(-)
+
+--- libaacs.orig/configure.ac
++++ libaacs/configure.ac
+@@ -91,7 +91,7 @@ AC_TYPE_SIGNAL
+ # required headers
+ AC_CHECK_HEADERS([stdarg.h sys/types.h dirent.h errno.h libgen.h malloc.h])
+ AC_CHECK_HEADERS([stdlib.h mntent.h linux/cdrom.h inttypes.h])
+-AC_CHECK_HEADERS([sys/time.h time.h sys/select.h])
++AC_CHECK_HEADERS([sys/time.h time.h sys/select.h limits.h])
+ 
+ # required structures
+ AC_STRUCT_DIRENT_D_TYPE
+--- libaacs.orig/src/libaacs/mmc.c
++++ libaacs/src/libaacs/mmc.c
+@@ -37,6 +37,10 @@
+ #include <mntent.h>
+ #endif
+ 
++#ifdef HAVE_LIMITS_H
++#include <limits.h>
++#endif
++
+ #ifdef HAVE_LINUX_CDROM_H
+ #include <sys/ioctl.h>
+ #include <linux/cdrom.h>
+@@ -384,8 +388,18 @@ MMC *mmc_open(const char *path)
+ #if defined(HAVE_MNTENT_H)
+ 
+ #ifdef HAVE_REALPATH
++#ifndef PATH_MAX
+     char *file_path = realpath(path, NULL);
+ #else
++    char *file_path = malloc(PATH_MAX);
++    if (!file_path || !realpath(path, file_path)) {
++        DEBUG(DBG_MMC, "Failed resolving path %s (%p)\n", path, mmc);
++        X_FREE(mmc);
++        X_FREE(file_path);
++        return NULL;
++    }
++#endif
++#else
+     char *file_path = (char*)malloc(strlen(path) + 1);
+     strcpy(file_path, path);
+ #endif
diff --git a/debian/patches/series b/debian/patches/series
index b5c7eee..a69218a 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 0001-buildsystem.patch
+0002-unresolved_mount_point.patch

-- 
libaacs packaging



More information about the pkg-multimedia-commits mailing list