Summary: | [s60]China Variant Crashes | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Rasvan Alexandrescu <rasvan.alexandrescu> | ||||||||||||||
Component: | WebCore Misc. | Assignee: | Nobody <webkit-unassigned> | ||||||||||||||
Status: | CLOSED FIXED | ||||||||||||||||
Severity: | Normal | Keywords: | PlatformOnly | ||||||||||||||
Priority: | P2 | ||||||||||||||||
Version: | 420+ | ||||||||||||||||
Hardware: | S60 Emulator | ||||||||||||||||
OS: | S60 3rd edition | ||||||||||||||||
Attachments: |
|
Description
Rasvan Alexandrescu
2006-10-25 07:50:47 PDT
Created attachment 11209 [details]
changes to the hbuf max size
Comment on attachment 11209 [details]
changes to the hbuf max size
r=me
Created attachment 11427 [details]
check for more reallocation condition
Created attachment 11429 [details]
check for more reallocation condition
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) );
Created attachment 11438 [details]
modified as suggested
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.
Created attachment 11441 [details]
latest changes
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
Created attachment 11445 [details]
modified and tested
Comment on attachment 11445 [details]
modified and tested
r=me
re-purposing InTSW keyword for use by QtWebkit team |