diff options
author | CoprDistGit <infra@openeuler.org> | 2024-08-01 14:59:28 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2024-08-01 14:59:28 +0000 |
commit | 54c2e843134660a26a8923517d09519ce884c422 (patch) | |
tree | d338e64c26d86c31821227b5e62daf1144fdd1f1 /expect-5.45-match-gt-numchars-segfault.patch | |
parent | 620ca363f3f7629f6b720c849aeb7a66a3e05ea0 (diff) |
automatic import of expectopeneuler24.03_LTSopeneuler23.09
Diffstat (limited to 'expect-5.45-match-gt-numchars-segfault.patch')
-rw-r--r-- | expect-5.45-match-gt-numchars-segfault.patch | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/expect-5.45-match-gt-numchars-segfault.patch b/expect-5.45-match-gt-numchars-segfault.patch new file mode 100644 index 0000000..1abd424 --- /dev/null +++ b/expect-5.45-match-gt-numchars-segfault.patch @@ -0,0 +1,17 @@ +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) { |