mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
334464 Crash when loading formhistory due to abuse of string APIs. Initialize using PRUnichar data with an explicit length. r=darin
This commit is contained in:
parent
84e9af60e2
commit
21963c6464
@ -938,12 +938,12 @@ nsFormHistory::InitByteOrder(PRBool aForce)
|
||||
// bigEndian and littleEndian are endianness markers that are stored in
|
||||
// the formhistory db as UTF-16. Define them to be strings easily
|
||||
// recognized in either endianness.
|
||||
nsAutoString bigEndianByteOrder((PRUnichar*)"BBBB");
|
||||
nsAutoString littleEndianByteOrder((PRUnichar*)"llll");
|
||||
nsAutoString bigEndianByteOrder((PRUnichar*)"BBBB", 2);
|
||||
nsAutoString littleEndianByteOrder((PRUnichar*)"llll", 2);
|
||||
#ifdef IS_BIG_ENDIAN
|
||||
nsAutoString nativeByteOrder(bigEndianByteOrder);
|
||||
nsAutoString& nativeByteOrder(bigEndianByteOrder);
|
||||
#else
|
||||
nsAutoString nativeByteOrder(littleEndianByteOrder);
|
||||
nsAutoString& nativeByteOrder(littleEndianByteOrder);
|
||||
#endif
|
||||
|
||||
nsAutoString fileByteOrder;
|
||||
|
Loading…
Reference in New Issue
Block a user