Package: gnubiff Version: 2.1.1-3 Severity: normal Tags: patch Gnubiff crashes on startup with a SIGSEGV. The problem is due to truncation of a 64-bit result to a 32-bit value. This patch fixes the immediate problem:
--- gnubiff-2.1.1/src/support.cc 2005-01-11 00:47:40.000000000 -0800 +++ gnubiff-2.1.1-davidm/src/support.cc 2005-03-28 11:35:52.000000000 -0800 @@ -88,8 +88,8 @@ gb_substitute(std::string format, std::string chars, std::vector<std::string> toinsert) { - guint pos=0,cpos,prevpos=0; - guint len=format.length(); + std::string::size_type pos=0,cpos,prevpos=0; + std::string::size_type len=format.length(); std::string result(""); while ((pos<len)&&(pos=format.find("%",prevpos))!=std::string::npos) The problem is that on 64-bit systems, string::npos == 0xffffffffffffffff, but since the result of the string searches are stored in "guint"-typed variables, which are only 32 bits in size, the search results are truncated to 32 bits. In particular, the comparison in this if-statement: if ((cpos = chars.find(format[pos+1])) == std::string::npos) continue; result += toinsert[cpos]; ends up comparing 0xffffffff against 0xffffffffffffffff when the searched character cannot be found. Since this will be FALSE, the subsequent access to "toinsert[cpos]" will cause an access to invalid memory and usually results in a segfault. The same bug is present in Gnubiff 2.1.2 and the CVS version, so I'll report this problem to the upstream maintainer as well. -- System Information: Debian Release: 3.1 APT prefers unstable APT policy: (990, 'unstable') Architecture: ia64 Kernel: Linux 2.6.12-rc1 Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968) Versions of packages gnubiff depends on: ii libart-2.0-2 2.3.17-1 Library of functions for 2D graphi ii libatk1.0-0 1.8.0-4 The ATK accessibility toolkit ii libbonobo2-0 2.8.1-2 Bonobo CORBA interfaces library ii libbonoboui2-0 2.8.1-2 The Bonobo UI library ii libc6.1 2.3.2.ds1-20 GNU C Library: Shared libraries an ii libfam0c102 2.7.0-6 client library to control the FAM ii libgcc1 1:3.4.3-12 GCC support library ii libgconf2-4 2.8.1-5 GNOME configuration database syste ii libglade2-0 1:2.4.2-2 library to load .glade files at ru ii libglib2.0-0 2.6.3-1 The GLib library of C routines ii libgnome2-0 2.8.1-2 The GNOME 2 library - runtime file ii libgnomecanvas2-0 2.8.0-1 A powerful object-oriented display ii libgnomeui-0 2.8.1-3 The GNOME 2 libraries (User Interf ii libgnomevfs2-0 2.8.4-2 The GNOME virtual file-system libr ii libgtk2.0-0 2.6.2-4 The GTK+ graphical user interface ii libice6 4.3.0.dfsg.1-12 Inter-Client Exchange library ii liborbit2 1:2.12.1-1 libraries for ORBit2 - a CORBA ORB ii libpanel-applet2-0 2.8.3-1 library for GNOME 2 panel applets ii libpango1.0-0 1.8.1-1 Layout and rendering of internatio ii libpopt0 1.7-5 lib for parsing cmdline parameters ii libsm6 4.3.0.dfsg.1-12 X Window System Session Management ii libssl0.9.7 0.9.7e-3 SSL shared libraries ii libstdc++5 1:3.3.5-12 The GNU Standard C++ Library v3 ii libxml2 2.6.16-4 GNOME XML library ii sox 12.17.7-2 A universal sound sample translato ii xlibs 4.3.0.dfsg.1-12 X Keyboard Extension (XKB) configu ii zlib1g 1:1.2.2-4 compression library - runtime -- no debconf information -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]