From 66081d37e42516f7380fb77937b075eac0a55a57 Mon Sep 17 00:00:00 2001 From: ViktorF Date: Tue, 26 May 2015 13:54:33 +0200 Subject: [PATCH] New package: detox-1.2.0 --- ...etox-1.2.0.fix-invalid-memory-access.patch | 24 +++++++++++++++++++ srcpkgs/detox/template | 15 ++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 srcpkgs/detox/patches/detox-1.2.0.fix-invalid-memory-access.patch create mode 100644 srcpkgs/detox/template diff --git a/srcpkgs/detox/patches/detox-1.2.0.fix-invalid-memory-access.patch b/srcpkgs/detox/patches/detox-1.2.0.fix-invalid-memory-access.patch new file mode 100644 index 00000000000..fd7bcc4898b --- /dev/null +++ b/srcpkgs/detox/patches/detox-1.2.0.fix-invalid-memory-access.patch @@ -0,0 +1,24 @@ +diff -up detox-1.2.0/parse_options_getopt.c.dt detox-1.2.0/parse_options_getopt.c +--- detox-1.2.0/parse_options_getopt.c.dt 2010-07-05 09:52:45.409372974 +0200 ++++ detox-1.2.0/parse_options_getopt.c 2010-07-05 10:02:55.698264851 +0200 +@@ -178,15 +178,17 @@ struct detox_options *parse_options_geto + main_options->files = malloc(sizeof(char *) * 10); + + i = 0; +- max = 0; ++ max = 10; + + if (optind < argc) { + while (optind < argc) { +- main_options->files[i++] = strdup(argv[optind]); +- if (i > max) { ++ /* not enough space for the next file and ++ possible ending NULL -> realloc */ ++ if (i + 2 > max) { + main_options->files = realloc(main_options->files, sizeof(char *) * (10 + max)); + max += 10; + } ++ main_options->files[i++] = strdup(argv[optind]); + + optind++; + } diff --git a/srcpkgs/detox/template b/srcpkgs/detox/template new file mode 100644 index 00000000000..90c7af90647 --- /dev/null +++ b/srcpkgs/detox/template @@ -0,0 +1,15 @@ +# Template file for 'detox' + +pkgname="detox" +version="1.2.0" +revision=1 +build_style=gnu-configure +configure_args="--prefix=/usr --sysconfdir=/etc/detox" +patch_args="-Np1" +short_desc="Utility designed to clean up filenames" +maintainer="Martin Födinger " +license="BSD" +homepage="http://detox.sourceforge.net/" +makedepends="flex libfl-devel" +distfiles="${SOURCEFORGE_SITE}/${pkgname}/${pkgname}-${version}.tar.bz2" +checksum="abfad90ee7d3e0fc53ce3b9da3253f9a800cdd92e3f8cc12a19394a7b1dcdbf8"