Package: libeditline0
Version: 1.12-5
Severity: important
Tags: patch

Forwarded from Ubuntu bug#307652[1]

    [1] https://bugs.launchpad.net/ubuntu/+source/editline/+bug/307652

libeditline0 trunkates the input lines at 64th character in batch mode.
This can easily break other software (as it did break firebird) when
the input file given to the binary linked with libeditline0 contains
lines longer than 64 characters.

Further analysis can be found in the Ubuntu bug. The patch attached to
this one is the same, only consistent with the tab-usage of upstream.


Having this in Lenny would be very nice.

Please tell me if I can help further with this bug.


-- System Information:
Debian Release: 5.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 
'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=bg_BG.UTF-8, LC_CTYPE=bg_BG.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libeditline0 depends on:
ii  libc6                         2.7-16     GNU C Library: Shared libraries

libeditline0 recommends no packages.

libeditline0 suggests no packages.

-- no debconf information
diff --git a/editline.c b/editline.c
index c8e0a2b..25815e9 100644
--- a/editline.c
+++ b/editline.c
@@ -1024,9 +1024,11 @@ read_redirected()
 
     for (size = MEM_INC, p = line = NEW(char, size), end = p + size; ; p++) {
 	if (p == end) {
+	    int lengthSoFar = p - line;
 	    size += MEM_INC;
-	    p = line = realloc(line, size);
-	    end = p + size;
+	    line = realloc(line, size);
+	    p = line + lengthSoFar;
+	    end = line + size;
 	}
 	if (read(0, p, 1) <= 0) {
 	    /* Ignore "incomplete" lines at EOF, just like we do for a tty. */

Reply via email to