sed: avoid crash when rregexec return error
This commit is contained in:
parent
1adb2a07bf
commit
ee85defda4
@ -994,7 +994,7 @@ match(Reprog *pattern, Rune *buf)
|
||||
return 0;
|
||||
subexp[0].s.rsp = buf;
|
||||
subexp[0].e.rep = 0;
|
||||
if (rregexec(pattern, linebuf, subexp, MAXSUB)) {
|
||||
if (rregexec(pattern, linebuf, subexp, MAXSUB) > 0) {
|
||||
loc1 = subexp[0].s.rsp;
|
||||
loc2 = subexp[0].e.rep;
|
||||
return 1;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user