Skip to content

Commit ebac9ae

Browse files
authoredJun 17, 2024··
timezone __secs_to_zone stub: guard against null pointer dereference (#507)
Closes #506
1 parent 3184536 commit ebac9ae

File tree

1 file changed

+8
-4
lines changed
  • libc-top-half/musl/src/time

1 file changed

+8
-4
lines changed
 

‎libc-top-half/musl/src/time/__tz.c

+8-4
Original file line numberDiff line numberDiff line change
@@ -434,10 +434,14 @@ weak_alias(__tzset, tzset);
434434
void __secs_to_zone(long long t, int local, int *isdst, int *offset, long *oppoff, const char **zonename)
435435
{
436436
// Minimalist implementation for now.
437-
*isdst = 0;
438-
*offset = 0;
439-
*oppoff = 0;
440-
*zonename = __utc;
437+
if (isdst)
438+
*isdst = 0;
439+
if (offset)
440+
*offset = 0;
441+
if (oppoff)
442+
*oppoff = 0;
443+
if (zonename)
444+
*zonename = __utc;
441445
}
442446
#endif
443447

0 commit comments

Comments
 (0)
Please sign in to comment.