Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37549051
en ru br
ALT Linux repos
S:5.45.4-alt4
5.0: 5.44-alt3
4.1: 5.44-alt2
4.0: 5.43-alt3
3.0: 5.43-alt1

Other repositories
Upstream:5.44.1

Group :: Development/Tcl
RPM: expect

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: expect-5.45-match-gt-numchars-segfault.patch
Download


diff -up expect5.45/expect.c.orig expect5.45/expect.c
--- expect5.45/expect.c.orig	2012-02-06 14:15:13.469490744 +0100
+++ expect5.45/expect.c	2012-02-06 14:16:23.596837896 +0100
@@ -2363,7 +2363,12 @@ expMatchProcess(
 
 	/* "!e" means no case matched - transfer by default */
 	if (!e || e->transfer) {
-	    int remainder = numchars-match;
+	    int remainder;
+	    if (match > numchars) {
+		match = numchars;
+		eo->matchlen = match;
+	    }
+	    remainder = numchars-match;
 	    /* delete matched chars from input buffer */
 	    esPtr->printed -= match;
 	    if (numchars != 0) {
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin