Changeset 2304 in webkit for trunk/JavaScriptCore
- Timestamp:
- Oct 10, 2002, 9:07:07 PM (23 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r2299 r2304 1 2002-10-10 Darin Adler <[email protected]> 2 3 - fixed 3072643 -- infinite loop in JavaScript code at walgreens.com 4 5 The problem is that "xxx".indexOf("", 1) needs to return 1, but we 6 were returning 0. 7 8 * kjs/ustring.cpp: 9 (UString::find): Return pos, not 0, when the search string is empty. 10 (UString::rfind): Make sure that pos is not past the end of the string, 11 taking into account the search string; fixes a potential read off the end 12 of the buffer. Also return pos, not 0, when the search string is empty. 13 1 14 === Alexander-27 === 2 15 -
trunk/JavaScriptCore/ChangeLog-2002-12-03
r2299 r2304 1 2002-10-10 Darin Adler <[email protected]> 2 3 - fixed 3072643 -- infinite loop in JavaScript code at walgreens.com 4 5 The problem is that "xxx".indexOf("", 1) needs to return 1, but we 6 were returning 0. 7 8 * kjs/ustring.cpp: 9 (UString::find): Return pos, not 0, when the search string is empty. 10 (UString::rfind): Make sure that pos is not past the end of the string, 11 taking into account the search string; fixes a potential read off the end 12 of the buffer. Also return pos, not 0, when the search string is empty. 13 1 14 === Alexander-27 === 2 15 -
trunk/JavaScriptCore/ChangeLog-2003-10-25
r2299 r2304 1 2002-10-10 Darin Adler <[email protected]> 2 3 - fixed 3072643 -- infinite loop in JavaScript code at walgreens.com 4 5 The problem is that "xxx".indexOf("", 1) needs to return 1, but we 6 were returning 0. 7 8 * kjs/ustring.cpp: 9 (UString::find): Return pos, not 0, when the search string is empty. 10 (UString::rfind): Make sure that pos is not past the end of the string, 11 taking into account the search string; fixes a potential read off the end 12 of the buffer. Also return pos, not 0, when the search string is empty. 13 1 14 === Alexander-27 === 2 15 -
trunk/JavaScriptCore/kjs/ustring.cpp
r1887 r2304 492 492 if (sz < fsz) 493 493 return -1; 494 if (fsz == 0)495 return 0;496 494 if (pos < 0) 497 495 pos = 0; 496 if (fsz == 0) 497 return pos; 498 498 const UChar *end = data() + sz - fsz; 499 499 long fsizeminusone = (fsz - 1) * sizeof(UChar); … … 524 524 if (sz < fsz) 525 525 return -1; 526 if (fsz == 0)527 return 0;528 526 if (pos < 0) 529 527 pos = 0; 528 if (pos > sz - fsz) 529 pos = sz - fsz; 530 if (fsz == 0) 531 return pos; 530 532 long fsizeminusone = (fsz - 1) * sizeof(UChar); 531 533 const UChar *fdata = f.data();
Note:
See TracChangeset
for help on using the changeset viewer.