| Index: src/runtime.cc
|
| diff --git a/src/runtime.cc b/src/runtime.cc
|
| index 518e96a99bfc0c1cf6f636793a5784d5e0373a5a..f6abd93b605df5a2194278d3ed61dafa229af293 100644
|
| --- a/src/runtime.cc
|
| +++ b/src/runtime.cc
|
| @@ -3603,7 +3603,7 @@ void FindAsciiStringIndices(Vector<const uint8_t> subject,
|
| const uint8_t* subject_start = subject.start();
|
| const uint8_t* subject_end = subject_start + subject.length();
|
| const uint8_t* pos = subject_start;
|
| - while (limit > 0) {
|
| + while ((limit > 0) && (subject_end > pos)) {
|
| pos = reinterpret_cast<const uint8_t*>(
|
| memchr(pos, pattern, subject_end - pos));
|
| if (pos == NULL) return;
|
|
|