[arch-commits] Commit in cmus/trunk (PKGBUILD fix_format_print.patch)

Ionut Biru ibiru at archlinux.org
Sun May 23 20:49:47 UTC 2010


    Date: Sunday, May 23, 2010 @ 16:49:47
  Author: ibiru
Revision: 80914

upgpkg: cmus 2.3.2-2
fix segmentation cause by gcc update. fixes FS#19560

Added:
  cmus/trunk/fix_format_print.patch
Modified:
  cmus/trunk/PKGBUILD

------------------------+
 PKGBUILD               |   10 ++++++---
 fix_format_print.patch |   48 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 55 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2010-05-23 13:28:17 UTC (rev 80913)
+++ PKGBUILD	2010-05-23 20:49:47 UTC (rev 80914)
@@ -4,7 +4,7 @@
 
 pkgname=cmus
 pkgver=2.3.2
-pkgrel=1
+pkgrel=2
 pkgdesc="A very feature-rich ncurses-based music player"
 arch=('i686' 'x86_64')
 url="http://cmus.sourceforge.net/"
@@ -13,12 +13,16 @@
 depends=('sh' 'libao' 'libmpcdec' 'ffmpeg' 'flac' 'libmad' 'faad2')
 makedepends=('libmp4v2')
 optdepends=('libmp4v2')
-source=("http://downloads.sourceforge.net/$pkgname/$pkgname-v$pkgver.tar.bz2")
-md5sums=('47698e355cff2e7b985a22475099c100')
+source=("http://downloads.sourceforge.net/$pkgname/$pkgname-v$pkgver.tar.bz2"
+	fix_format_print.patch)
+md5sums=('47698e355cff2e7b985a22475099c100'
+         '3d62fa9030cd054eb5fa0a275fd1964a')
 
 build() {
   cd $srcdir/$pkgname-v$pkgver
 
+  patch -Np1 -i $srcdir/fix_format_print.patch || return 1
+
   export CONFIG_ARTS=n
   ./configure prefix=/usr || return 1
   make || return 1

Added: fix_format_print.patch
===================================================================
--- fix_format_print.patch	                        (rev 0)
+++ fix_format_print.patch	2010-05-23 20:49:47 UTC (rev 80914)
@@ -0,0 +1,48 @@
+From 2e679c66554cc0205779a72b82ddcc0175f571a6 Mon Sep 17 00:00:00 2001
+From: Gregory Petrosyan <gregory.petrosyan at gmail.com>
+Date: Sun, 23 May 2010 20:02:58 +0400
+Subject: [PATCH] Fix format_print()'s buffer width calculation
+
+This solves reported memory corruptions and crashes.
+Looks like this bug was uncovered due to a GCC upgrade.
+
+Reported-by: Vlastimil Kotas <vlastikx at kralikbobek.cz>
+Reported-by: evinupavi662 at arcor.de
+Triaged-by: Xavier Chantry <chantry.xavier at gmail.com>
+Acked-by: Xavier Chantry <chantry.xavier at gmail.com>
+Signed-off-by: Gregory Petrosyan <gregory.petrosyan at gmail.com>
+---
+ ui_curses.c |    8 +++++---
+ 1 files changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/ui_curses.c b/ui_curses.c
+index 0a390a0..ce6d334 100644
+--- a/ui_curses.c
++++ b/ui_curses.c
+@@ -104,7 +104,9 @@ static char print_buffer[512];
+ /* destination buffer for utf8_encode and utf8_decode */
+ static char conv_buffer[512];
+ 
+-#define print_buffer_size (sizeof(print_buffer) - 1)
++/* one character can take up to 4 bytes in UTF-8 */
++#define print_buffer_max_width (sizeof(print_buffer) / 4 - 1)
++
+ static int using_utf8;
+ 
+ static const char *t_ts;
+@@ -1181,10 +1183,10 @@ static void do_update_titleline(void)
+ 
+ 		/* set window title */
+ 		if (use_alt_format) {
+-			format_print(print_buffer, sizeof(print_buffer) - 1,
++			format_print(print_buffer, print_buffer_max_width,
+ 					window_title_alt_format, track_fopts);
+ 		} else {
+-			format_print(print_buffer, sizeof(print_buffer) - 1,
++			format_print(print_buffer,  print_buffer_max_width,
+ 					window_title_format, track_fopts);
+ 		}
+ 
+-- 
+1.6.1
+




More information about the arch-commits mailing list