Bug 11414 - [s60]China Variant Crashes
Summary: [s60]China Variant Crashes
Status: CLOSED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 420+
Hardware: S60 Emulator S60 3rd edition
: P2 Normal
Assignee: Nobody
URL:
Keywords: PlatformOnly
Depends on:
Blocks:
 
Reported: 2006-10-25 07:50 PDT by Rasvan Alexandrescu
Modified: 2011-03-21 11:52 PDT (History)
0 users

See Also:


Attachments
changes to the hbuf max size (11.28 KB, patch)
2006-10-25 07:53 PDT, Rasvan Alexandrescu
zalan: review+
Details | Formatted Diff | Diff
check for more reallocation condition (5.41 KB, patch)
2006-11-08 12:07 PST, Rasvan Alexandrescu
no flags Details | Formatted Diff | Diff
check for more reallocation condition (3.41 KB, patch)
2006-11-08 13:22 PST, Rasvan Alexandrescu
zalan: review-
Details | Formatted Diff | Diff
modified as suggested (3.41 KB, patch)
2006-11-09 08:24 PST, Rasvan Alexandrescu
zalan: review-
Details | Formatted Diff | Diff
latest changes (3.55 KB, patch)
2006-11-09 09:29 PST, Rasvan Alexandrescu
zalan: review-
Details | Formatted Diff | Diff
modified and tested (3.55 KB, patch)
2006-11-09 12:36 PST, Rasvan Alexandrescu
zalan: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rasvan Alexandrescu 2006-10-25 07:50:47 PDT
Browser Crash when search with Google using chinese characters and spaces
Comment 1 Rasvan Alexandrescu 2006-10-25 07:53:41 PDT
Created attachment 11209 [details]
changes to the hbuf max size
Comment 2 zalan 2006-10-26 12:12:56 PDT
Comment on attachment 11209 [details]
changes to the hbuf max size

r=me
Comment 3 zalan 2006-10-26 12:31:06 PDT
3.1m r17335
3.2 r17336
Comment 4 Rasvan Alexandrescu 2006-11-08 12:07:02 PST
Created attachment 11427 [details]
check for more reallocation condition
Comment 5 Rasvan Alexandrescu 2006-11-08 13:22:49 PST
Created attachment 11429 [details]
check for more reallocation condition
Comment 6 zalan 2006-11-08 13:45:12 PST
Comment on attachment 11429 [details]
check for more reallocation condition

checkRealloc should take two parameters, the current buffer and the length you want to expand to and return the new buffer.
so instead of
TBool checkRealloc( HBufC8*  aBuf, TPtr8& aPtr, TInt aLen )
you should have something like
HBufC8* checkRealloc( TPtrC8& , TInt  ) 

then you dont have to do tricks like this
//
HBufC8* temp = aBuf->ReAlloc( maxlen + (len == maxlen ? 1 : aLen) );
Comment 7 Rasvan Alexandrescu 2006-11-09 08:24:55 PST
Created attachment 11438 [details]
modified as suggested
Comment 8 zalan 2006-11-09 08:43:18 PST
Comment on attachment 11438 [details]
modified as suggested

1, ptr.Length() + tmpBuf.Length() should be passed to checkRealloc instead of tmpBuf.Length()
2, outBuf->Des().Copy( aPtr ) should be used instead of outBuf->operator=(aPtr);
as the buffer that aPtr points to is destroyed right after checkRealloc returns (delete outBuf;)
3, checkRealloc should not leave, it should return null in case of oom.
Comment 9 Rasvan Alexandrescu 2006-11-09 09:29:15 PST
Created attachment 11441 [details]
latest changes
Comment 10 zalan 2006-11-09 09:36:58 PST
Comment on attachment 11441 [details]
latest changes

checkRealloc still leaves. please either trap NewMaxL or use a non-leaving version of it.
please also make sure that this patch fixes your test case
Comment 11 Rasvan Alexandrescu 2006-11-09 12:36:06 PST
Created attachment 11445 [details]
modified and tested
Comment 12 zalan 2006-11-09 13:45:12 PST
Comment on attachment 11445 [details]
modified and tested 

r=me
Comment 13 zalan 2006-11-09 13:49:12 PST
3.1m r17692
3.2 r17693
Comment 14 Joel Parks 2011-03-21 11:52:43 PDT
re-purposing InTSW keyword for use by QtWebkit team