Hi,

unfortunately, I had a typo in the list address.
So here is my proposal to fix ncurses/testing.

Kind regards

T.
--- Begin Message ---
tags 506717 + patch pending
severity 506717 serious
thanks

Hi everyone,

actually, ncurses-using applications (e.g. aptitude) will crash without
this patch. As such this should be fixed in testing.
Attached is a proposed t-p-u upload.

Kind regards

T.


diff -u ncurses-5.6+20080830/debian/changelog 
ncurses-5.6+20080830/debian/changelog
--- ncurses-5.6+20080830/debian/changelog
+++ ncurses-5.6+20080830/debian/changelog
@@ -1,3 +1,12 @@
+ncurses (5.6+20080830-1.1) testing; urgency=low
+
+  * Non-maintainer upload for testing.
+  * Ensure that aalib checks the value returned by Gpm_GetEvent()
+    and only proceeds if value == 1. (Closes: #506717)
+  * Analysis and patch by Samual Thibault. Thanks!
+
+ -- Thomas Viehmann <[EMAIL PROTECTED]>  Sun, 30 Nov 2008 00:36:58 +0100
+
 ncurses (5.6+20080830-1) unstable; urgency=medium
 
   * Merging upstream version 5.6+20080830.
diff -u ncurses-5.6+20080830/debian/patches/00list 
ncurses-5.6+20080830/debian/patches/00list
--- ncurses-5.6+20080830/debian/patches/00list
+++ ncurses-5.6+20080830/debian/patches/00list
@@ -5,0 +6 @@
+06-check-gpm-getevent-return-values.dpatch
only in patch2:
unchanged:
--- 
ncurses-5.6+20080830.orig/debian/patches/06-check-gpm-getevent-return-values.dpatch
+++ 
ncurses-5.6+20080830/debian/patches/06-check-gpm-getevent-return-values.dpatch
@@ -0,0 +1,35 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 06-check-gpm-getevent-return-values.dpatch by Samuel Thibault
+##
+## DP: Check the return value of Gpm_GetEvent to prevent locking up
+## DP: when gpm is not available in X
+
[EMAIL PROTECTED]@
+
+--- a/ncurses/base/lib_mouse.c 2008-11-24 00:29:19.000000000 +0100
++++ b/ncurses/base/lib_mouse.c 2008-11-24 00:31:12.000000000 +0100
+@@ -651,7 +651,15 @@
+           /* query server for event, return TRUE if we find one */
+           Gpm_Event ev;
+ 
+-          if (my_Gpm_GetEvent(&ev) == 1) {
++          if (sp->_mouse_fd == -1)
++              break;
++
++          switch (my_Gpm_GetEvent(&ev)) {
++          case 0:
++              /* Connection closed, drop the mouse. */
++              sp->_mouse_fd = -1;
++              break;
++          case 1:
+               /* there's only one mouse... */
+               eventp->id = NORMAL_EVENT;
+ 
+@@ -684,6 +692,7 @@
+               /* bump the next-free pointer into the circular list */
+               sp->_mouse_eventp = eventp = NEXT(eventp);
+               result = TRUE;
++              break;
+           }
+       }
+       break;


--- End Message ---

Reply via email to