replicant-frameworks_native/libs/binder
Pravat Dalbehera d1dff8d4d4 Fix for writing empty strings to Parcel::writeString8()
If writeString8 is called with the following sequence:

 writeString8(String8(""));
 writeString8(String8("TempString"));

Then in the readString8, the 2nd String i.e. "TempString" is not read,
instead an empty string is read.

The bug comes because of the write call for String8("") where there are
no String bytes present. In the write Statement, an extra ‘\0’ is
written. During the Marshalling, Following bytes are written:

1        2         3        4       5   ...
0x0      0x0       0xB      ‘T’     ‘e’  ...

The readString8 function has a check that, if String length is 0, don’t
read anything. So the first byte is read as the length for the first
string. The second byte i.e. ‘\0’ is read as the length for the second
string and hence the second string becomes empty too.

Change-Id: Id7acc0c80ae16e77be4331f1ddf69ea87e758420
2010-12-22 12:57:31 +01:00
..
Android.mk Make static versions of libutils and libbinder. 2010-05-06 01:03:31 -07:00
Binder.cpp Make static versions of libutils and libbinder. 2010-05-06 01:03:31 -07:00
BpBinder.cpp
IInterface.cpp
IMemory.cpp fix [2599939] "cannot play video" after open/close a video player a dozen of times 2010-04-19 19:09:03 -07:00
IPCThreadState.cpp Some debugging support. 2010-09-24 13:11:55 -07:00
IPermissionController.cpp Add Parcel::readExceptionCode() and Parcel::writeNoException() 2010-07-13 15:45:18 -07:00
IServiceManager.cpp Add Parcel::readExceptionCode() and Parcel::writeNoException() 2010-07-13 15:45:18 -07:00
MemoryBase.cpp
MemoryDealer.cpp Simplify the MemoryDealer implementation 2010-01-29 14:51:06 -08:00
MemoryHeapBase.cpp libbinder: add a NO_CACHING flag to MemoryHeapBase 2009-10-30 18:35:47 -07:00
MemoryHeapPmem.cpp Simplify the MemoryDealer implementation 2010-01-29 14:51:06 -08:00
Parcel.cpp Fix for writing empty strings to Parcel::writeString8() 2010-12-22 12:57:31 +01:00
Permission.cpp
ProcessState.cpp Modify the binder to request 1M - 2 pages instead of 1M. The backing store 2009-11-12 16:31:12 -08:00
Static.cpp