commit ee85defda48d1d6b7c18b9fab7140c6598d2f658 from: Russ Cox date: Thu Feb 05 04:13:18 2009 UTC sed: avoid crash when rregexec return error commit - 1adb2a07bff16932f070a29af8460c35be34fb65 commit + ee85defda48d1d6b7c18b9fab7140c6598d2f658 blob - a463e07187296ba35d54c2bca65b94f2880a37ff blob + 5849c83fb955a0f2b4534c6904f42c8a12dd19c4 --- src/cmd/sed.c +++ src/cmd/sed.c @@ -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;