Fixed memory overrun in mysql_tzinfo_to_sql

This commit is contained in:
Michael Widenius 2011-05-26 18:35:26 +03:00
parent e2962ee07e
commit 73f78f7766

View File

@ -214,7 +214,7 @@ tz_load(const char *name, TIME_ZONE_INFO *sp, MEM_ROOT *storage)
ALIGN_SIZE(sp->typecnt * ALIGN_SIZE(sp->typecnt *
sizeof(TRAN_TYPE_INFO)) + sizeof(TRAN_TYPE_INFO)) +
#ifdef ABBR_ARE_USED #ifdef ABBR_ARE_USED
ALIGN_SIZE(sp->charcnt) + ALIGN_SIZE(sp->charcnt+1) +
#endif #endif
sp->leapcnt * sizeof(LS_INFO)))) sp->leapcnt * sizeof(LS_INFO))))
return 1; return 1;
@ -227,7 +227,7 @@ tz_load(const char *name, TIME_ZONE_INFO *sp, MEM_ROOT *storage)
tzinfo_buf+= ALIGN_SIZE(sp->typecnt * sizeof(TRAN_TYPE_INFO)); tzinfo_buf+= ALIGN_SIZE(sp->typecnt * sizeof(TRAN_TYPE_INFO));
#ifdef ABBR_ARE_USED #ifdef ABBR_ARE_USED
sp->chars= tzinfo_buf; sp->chars= tzinfo_buf;
tzinfo_buf+= ALIGN_SIZE(sp->charcnt); tzinfo_buf+= ALIGN_SIZE(sp->charcnt+1);
#endif #endif
sp->lsis= (LS_INFO *)tzinfo_buf; sp->lsis= (LS_INFO *)tzinfo_buf;