Package: ncurses-hexedit
Version: 0.9.7-14
Severity: normal
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu jaunty ubuntu-patch


Here are the steps to repeat the problem. 

1. Run hexeditor on a small file
2. ^W and choose "search for Hex bytes"
3. Enter a value not in the file and press enter, get "String not found", hit 
enter to clear that dialog.
4. Hit ^W and choose "Find Next"

*** /tmp/tmpV4CbaG
In Ubuntu, we've applied the attached patch to achieve the following:

  * src/windows.c: Fixes a crash which was caused by searching for
    values that were not in the file being viewed.
    Thanks to Jakob Hilmer for the patch. (LP: #122349)

We thought you might be interested in doing the same. 


-- System Information:
Debian Release: 5.0
  APT prefers jaunty-updates
  APT policy: (500, 'jaunty-updates'), (500, 'jaunty-security'), (500, 'jaunty')
Architecture: i386 (i686)

Kernel: Linux 2.6.28-13-generic (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff -u ncurses-hexedit-0.9.7/debian/control ncurses-hexedit-0.9.7/debian/control
--- ncurses-hexedit-0.9.7/debian/control
+++ ncurses-hexedit-0.9.7/debian/control
@@ -1,7 +1,8 @@
 Source: ncurses-hexedit
 Section: editors
 Priority: optional
-Maintainer: Manfred Lichtenstern <manf...@lichtenstern.biz>
+Maintainer: Ubuntu MOTU Developers <ubuntu-m...@lists.ubuntu.com>
+XSBC-Original-Maintainer: Manfred Lichtenstern <manf...@lichtenstern.biz>
 Build-Depends: debhelper (>> 5.0.0), libncurses5-dev (>> 5.0.0)
 Standards-Version: 3.8.0
 
diff -u ncurses-hexedit-0.9.7/debian/changelog ncurses-hexedit-0.9.7/debian/changelog
diff -u ncurses-hexedit-0.9.7/src/windows.c ncurses-hexedit-0.9.7/src/windows.c
--- ncurses-hexedit-0.9.7/src/windows.c
+++ ncurses-hexedit-0.9.7/src/windows.c
@@ -692,20 +692,21 @@
             spot = boyer_moore_search (retr->str, offset + 1,
                                  last_str_len = retr->len,
                                  Globals.filesize - offset);
+         if (laststr)
+            free (laststr);
+         laststr = malloc (retr->len + 1);
+         memset (laststr, 0x00, retr->len + 1);
+         memcpy (laststr, retr->str, retr->len);
+         free (retr->str);
+         retr->str = NULL;
+         retr->len = 0;
+
          if (spot && spot->flag)
          {
             offset += spot->offset + 1; /* started search one character
                                           ahead of offset */
             cursor_y = 1;
             cursor_x = mappos (offset & M_0x0F);
-            if (laststr)
-               free (laststr);
-            laststr = malloc (retr->len + 1);
-            memset (laststr, 0x00, retr->len + 1);
-            memcpy (laststr, retr->str, retr->len);
-            free (retr->str);
-            retr->str = NULL;
-            retr->len = 0;
          }
          else
          {
only in patch2:
unchanged:
--- ncurses-hexedit-0.9.7.orig/config.log
+++ ncurses-hexedit-0.9.7/config.log
@@ -0,0 +1,5 @@
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+configure:557: checking for a BSD compatible install
+configure:610: checking whether build environment is sane

Reply via email to