Re: com php-src: Fix segfault in ext/date since 957aa2: ext/date/lib/parse_tz.c

From: Date: Tue, 28 Apr 2015 11:15:07 +0000
Subject: Re: com php-src: Fix segfault in ext/date since 957aa2: ext/date/lib/parse_tz.c
References: 1  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-86532@lists.php.net to get a copy of this message
Hi, Just for reference, this fix is incorrect. It would break reading the location for f.e. Europe/Oslo. The problem here is not that, as I originally thought, the 64-bit db had ome more item, but rather that it could have a different amount of transitions, which are correctly encoded in the 2nd header. So the correct patch is to read both headers, and use the information in the second one to get the correct amount of transitions for the 64bit version of the DB. A patch is on the way - after a few more tests. cheers, Derick On Tue, 28 Apr 2015, Matteo Beccati wrote: > Commit: b5e5098c50397ed910a79ac1d64b7d0fff2c02e1 > Author: Matteo Beccati <mbeccati@php.net> Tue, 28 Apr 2015 10:57:18 +0200 > Parents: 13c32a102c7626673f41dfecba4188a6c6c6934c > Branches: PHP-5.5 PHP-5.6 master > > Link: > http://git.php.net/?p=php-src.git;a=commitdiff;h=b5e5098c50397ed910a79ac1d64b7d0fff2c02e1 > > Log: > Fix segfault in ext/date since 957aa2 > > Changed paths: > M ext/date/lib/parse_tz.c > > > Diff: > diff --git a/ext/date/lib/parse_tz.c b/ext/date/lib/parse_tz.c > index 89b8af7..32ed639 100644 > --- a/ext/date/lib/parse_tz.c > +++ b/ext/date/lib/parse_tz.c > @@ -89,8 +89,8 @@ static void read_header(const unsigned char **tzf, timelib_tzinfo *tz) > static void skip_transistions_64bit(const unsigned char **tzf, timelib_tzinfo *tz) > { > if (tz->timecnt) { > - *tzf += (sizeof(int64_t) * (tz->timecnt + 1)); > - *tzf += (sizeof(unsigned char) * (tz->timecnt + 1)); > + *tzf += (sizeof(int64_t) * (tz->timecnt)); > + *tzf += (sizeof(unsigned char) * (tz->timecnt)); > } > } > > > -- > PHP CVS Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- http://derickrethans.nl | http://xdebug.org Like Xdebug? Consider a donation: http://xdebug.org/donate.php twitter: @derickr and @xdebug Posted with an email client that doesn't mangle email: alpine

« previous php.cvs (#86532) next »