svn commit: samba r19602 - in branches: SAMBA_3_0_23/source/lib
SAMBA_3_0_24/source/lib
Stefan (metze) Metzmacher
metze at samba.org
Tue Nov 7 10:49:20 GMT 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
tridge at samba.org schrieb:
> Metze,
>
> > I assume this has bugs, as tm->tm_mon == 12 is valid and the array which
> > uses it as index has only 12 members...
> >
> > tridge: had you gave me a reason, why you used > 12 in the samba4 commit?
>
> I use > 12 because a value of 12 doesn't cause a segv. The loop is:
>
> for (i = 0; i < tm->tm_mon; ++i)
> res += ndays[is_leap(tm->tm_year)][i];
>
> so i goes to max 11 with tm_mon == 12. That is fine with the array
> given.
>
> Really what this means is the '31' for December is not actually needed
> in the code, which makes sense, as you never need to know how many
> days in December in this calculation (as its implied in the 365
> value).
>
> anyway, either > 11 or > 12 is fine, both will stop the potential
> segv.
hmm, ok:-)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org
iD8DBQFFUGSwm70gjA5TCD8RAs44AJ9xNw7Yd42UMtkS+N4M5Gz4zYVfHwCfU5ZH
i352WHa47qVMm0WCg9AM1/Y=
=d90k
-----END PGP SIGNATURE-----
More information about the samba-technical
mailing list