Blame SOURCES/expect-5.45-match-gt-numchars-segfault.patch

261060
diff -up expect5.45/expect.c.orig expect5.45/expect.c
261060
--- expect5.45/expect.c.orig	2012-02-06 14:15:13.469490744 +0100
261060
+++ expect5.45/expect.c	2012-02-06 14:16:23.596837896 +0100
261060
@@ -2363,7 +2363,12 @@ expMatchProcess(
261060
 
261060
 	/* "!e" means no case matched - transfer by default */
261060
 	if (!e || e->transfer) {
261060
-	    int remainder = numchars-match;
261060
+	    int remainder;
261060
+	    if (match > numchars) {
261060
+		match = numchars;
261060
+		eo->matchlen = match;
261060
+	    }
261060
+	    remainder = numchars-match;
261060
 	    /* delete matched chars from input buffer */
261060
 	    esPtr->printed -= match;
261060
 	    if (numchars != 0) {