summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-18 23:00:27 +0000
committerbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-18 23:00:27 +0000
commitd0d98329ebf165472c5142765fbe441d98f980af (patch)
tree4887b9634f02857722815e1d276c3b67549e2c96 /webkit
parent53ec0a4ac9269a7e4a1bce6e0204e8eda9846ed7 (diff)
downloadchromium_src-d0d98329ebf165472c5142765fbe441d98f980af.zip
chromium_src-d0d98329ebf165472c5142765fbe441d98f980af.tar.gz
chromium_src-d0d98329ebf165472c5142765fbe441d98f980af.tar.bz2
Fix full text indexing. My crash fix was overly aggressive and it was stopping
getting the text after there was a node with NULL text. It turns out this happens legitimatly all the time. I changed the condition to only detect the case that caused the crash and not all NULL nodes. BUG=1331396 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1004 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/glue/webframe_impl.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/webkit/glue/webframe_impl.cc b/webkit/glue/webframe_impl.cc
index 8d08a5d..1617c57 100644
--- a/webkit/glue/webframe_impl.cc
+++ b/webkit/glue/webframe_impl.cc
@@ -206,20 +206,19 @@ static void FrameContentAsPlainText(int max_chars, Frame* frame,
// string conversion.
for (TextIterator it(range.get()); !it.atEnd(); it.advance()) {
const wchar_t* chars = reinterpret_cast<const wchar_t*>(it.characters());
- if (!chars) {
+ if (!chars && it.length() != 0) {
// It appears from crash reports that an iterator can get into a state
// where the character count is nonempty but the character pointer is
// NULL. advance()ing it will then just add that many to the NULL
// pointer which won't be caught in a NULL check but will crash.
//
- // So as soon as we see a NULL character pointer, we know that the
- // iterator is done and we should not continue.
+ // A NULL pointer and 0 length is common for some nodes.
//
// IF YOU CATCH THIS IN A DEBUGGER please let brettw know. We don't
// currently understand the conditions for this to occur. Ideally, the
// iterators would never get into the condition so we should fix them
// if we can.
- DCHECK(it.length() == 0);
+ NOTREACHED();
break;
}
int to_append = std::min(it.length(),