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:
Augustin Cavalier
2023-10-28 16:36:12 -04:00
parent c199c568de
commit e8d328979c
2 changed files with 24 additions and 12 deletions
@@ -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;