ICUTimeConversion: Fix buffer overflows and add more error handling.
* Declare databridge buffer lengths in LocaleBackend. * Use strcpy instead of strlcpy when writing to databridge buffers (this is the first fix for #18598.) * Check for overflows and error out when they happen. * Verify that ICU actually knows the timezone in question and fall back to GMT if it does not (this would also fix that crash.) Fixes #18598.
This commit is contained in:
@@ -102,12 +102,14 @@ struct LocaleTimeDataBridge {
|
||||
|
||||
|
||||
struct TimeConversionDataBridge {
|
||||
static const int32 kTZNameLength = 64;
|
||||
|
||||
private:
|
||||
int localDaylight;
|
||||
long localTimezone;
|
||||
char* localTZName[2];
|
||||
char localTZName0[64];
|
||||
char localTZName1[64];
|
||||
char localTZName0[kTZNameLength];
|
||||
char localTZName1[kTZNameLength];
|
||||
|
||||
public:
|
||||
int* addrOfDaylight;
|
||||
|
||||
Reference in New Issue
Block a user