[arch-commits] Commit in iniparser/trunk (2 files)

Evangelos Foutras foutrelis at archlinux.org
Tue Jun 30 07:49:52 UTC 2015


    Date: Tuesday, June 30, 2015 @ 09:49:52
  Author: foutrelis
Revision: 241418

upgpkg: iniparser 4.0-2

Fix memory corruption (FS#45039).

Added:
  iniparser/trunk/0001-allocate-memory-for-string-termination.patch
Modified:
  iniparser/trunk/PKGBUILD

---------------------------------------------------+
 0001-allocate-memory-for-string-termination.patch |   26 ++++++++++++++++++++
 PKGBUILD                                          |   13 +++++++---
 2 files changed, 36 insertions(+), 3 deletions(-)

Added: 0001-allocate-memory-for-string-termination.patch
===================================================================
--- 0001-allocate-memory-for-string-termination.patch	                        (rev 0)
+++ 0001-allocate-memory-for-string-termination.patch	2015-06-30 07:49:52 UTC (rev 241418)
@@ -0,0 +1,26 @@
+From 3d385e4f2aba5122d9e40481c4aec9135b96428a Mon Sep 17 00:00:00 2001
+From: Christian Hesse <mail at eworm.de>
+Date: Thu, 21 May 2015 10:07:32 +0200
+Subject: [PATCH] allocate memory for string termination
+
+This fixes invalid write.
+---
+ src/iniparser.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/iniparser.c b/src/iniparser.c
+index 1eb1004..c8a728e 100644
+--- a/src/iniparser.c
++++ b/src/iniparser.c
+@@ -66,7 +66,7 @@ static const char * strlwc(const char * in, char *out, unsigned len)
+ /*--------------------------------------------------------------------------*/
+ static char * _strdup(const char *s)
+ {
+-    char * copy = (char*) malloc(strlen(s));
++    char * copy = (char*) malloc(strlen(s) + 1);
+     strcpy(copy, s);
+     return copy ;
+ }
+-- 
+2.4.5
+

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2015-06-30 05:47:00 UTC (rev 241417)
+++ PKGBUILD	2015-06-30 07:49:52 UTC (rev 241418)
@@ -5,7 +5,7 @@
 
 pkgname=iniparser
 pkgver=4.0
-pkgrel=1
+pkgrel=2
 pkgdesc="A free stand-alone ini file parsing library written in portable ANSI C"
 arch=('i686' 'x86_64')
 url="http://ndevilla.free.fr/iniparser/"
@@ -12,9 +12,16 @@
 license=('MIT')
 depends=('glibc')
 makedepends=('chrpath')
-source=(https://github.com/ndevilla/iniparser/archive/v$pkgver.tar.gz)
-md5sums=('94c7278f8d22de1a31320219b27634b0')
+source=($pkgname-$pkgver.tar.gz::https://github.com/ndevilla/iniparser/archive/v$pkgver.tar.gz
+        0001-allocate-memory-for-string-termination.patch)
+md5sums=('94c7278f8d22de1a31320219b27634b0'
+         '1ca2f65886484ea151d5076e09782c28')
 
+prepare() {
+  cd $srcdir/$pkgname-$pkgver
+  patch -Np1 -i ../0001-allocate-memory-for-string-termination.patch
+}
+
 build() {
   cd $srcdir/$pkgname-$pkgver
   make



More information about the arch-commits mailing list