diff options
author | Tobias Stoeckmann <tobias@cvs.openbsd.org> | 2008-06-11 02:19:14 +0000 |
---|---|---|
committer | Tobias Stoeckmann <tobias@cvs.openbsd.org> | 2008-06-11 02:19:14 +0000 |
commit | 5739b8928a4f63a5b2481383b7afc7076973606d (patch) | |
tree | 0dc7c9ed718b93ea7a822edcdb2dbf56c1f0fb27 /usr.bin/cvs/entries.c | |
parent | 2d78e6e42241150fbd1fb65ecc37b5fab793e8b6 (diff) |
Avoid possible NULL pointer dereferences by using reentrant versions
of time functions.
ok joris
Diffstat (limited to 'usr.bin/cvs/entries.c')
-rw-r--r-- | usr.bin/cvs/entries.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/cvs/entries.c b/usr.bin/cvs/entries.c index 6ea873fa539..6c4d8848a9c 100644 --- a/usr.bin/cvs/entries.c +++ b/usr.bin/cvs/entries.c @@ -1,4 +1,4 @@ -/* $OpenBSD: entries.c,v 1.96 2008/06/09 22:31:24 tobias Exp $ */ +/* $OpenBSD: entries.c,v 1.97 2008/06/11 02:19:13 tobias Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -479,7 +479,7 @@ cvs_write_tagfile(const char *dir, char *tag, char *date) RCSNUM *rev; char tagpath[MAXPATHLEN]; char sticky[CVS_REV_BUFSZ]; - struct tm *datetm; + struct tm datetm; int i; cvs_log(LP_TRACE, "cvs_write_tagfile(%s, %s, %s)", dir, @@ -511,9 +511,9 @@ cvs_write_tagfile(const char *dir, char *tag, char *date) "T%s", tag); } } else { - datetm = gmtime(&cvs_specified_date); + gmtime_r(&cvs_specified_date, &datetm); (void)strftime(sticky, sizeof(sticky), - "D"CVS_DATE_FMT, datetm); + "D"CVS_DATE_FMT, &datetm); } if (cvs_server_active == 1) |