[SSSD] [PATCH] sudo: set tm_isdst when converting time attributes
Jakub Hrozek
jhrozek at redhat.com
Wed Jan 29 13:57:09 UTC 2014
On Wed, Jan 29, 2014 at 02:45:49PM +0100, Pavel Březina wrote:
> On 01/29/2014 01:29 PM, Jakub Hrozek wrote:
> >On Wed, Jan 29, 2014 at 12:58:24PM +0100, Pavel Březina wrote:
> >>https://fedorahosted.org/sssd/ticket/2213
> >
> >> for (format = formats; *format != NULL; format++) {
> >> tret = strptime(str, *format, &tm);
> >> if (tret != NULL && *tret == '\0') {
> >>+ /* strptime() leaves isdst uninitialized. We set it to zero to
> >>+ * disable daylight saving time conversion. */
> >>+ tm.tm_isdst = 0;
> >>+
> >
> >Isn't it safer to memset the tm structure to zero before calling
> >strptime? That way you'd be protected against any other fields being
> >uninitialized as well.
>
> You are probably right. New patch is attached.
>
ACK
More information about the sssd-devel
mailing list