1 Star 0 Fork 5

hongjinghao/expect

forked from src-openEuler/expect 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
expect-5.45-match-gt-numchars-segfault.patch 591 Bytes
一键复制 编辑 原始数据 按行查看 历史
hexiaowen 提交于 2019-09-30 10:38 . Package init
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) {
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/hongjinghao/expect.git
[email protected]:hongjinghao/expect.git
hongjinghao
expect
expect
master

搜索帮助