sed: avoid crash when rregexec return error
This commit is contained in:
parent
1adb2a07bf
commit
ee85defda4
1 changed files with 1 additions and 1 deletions
|
|
@ -994,7 +994,7 @@ match(Reprog *pattern, Rune *buf)
|
||||||
return 0;
|
return 0;
|
||||||
subexp[0].s.rsp = buf;
|
subexp[0].s.rsp = buf;
|
||||||
subexp[0].e.rep = 0;
|
subexp[0].e.rep = 0;
|
||||||
if (rregexec(pattern, linebuf, subexp, MAXSUB)) {
|
if (rregexec(pattern, linebuf, subexp, MAXSUB) > 0) {
|
||||||
loc1 = subexp[0].s.rsp;
|
loc1 = subexp[0].s.rsp;
|
||||||
loc2 = subexp[0].e.rep;
|
loc2 = subexp[0].e.rep;
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue