openbsd-ports/misc/calentool/patches/patch-utils_c
naddy db65ac5a61 Fix a one-byte buffer overflow reported by Tim Donahue
<tdonahue@vonmail.vonworldwide.com> and a very wrong type conversion.
2006-05-27 16:54:16 +00:00

21 lines
397 B
Plaintext

$OpenBSD: patch-utils_c,v 1.2 2006/05/27 16:54:16 naddy Exp $
--- utils.c.orig Wed Sep 30 04:38:24 1998
+++ utils.c Sat May 27 18:11:00 2006
@@ -164,13 +164,15 @@ get_today()
#ifndef CALENCHECK
char timstr[16];
#endif
+ time_t t;
#ifdef SVR4
gettimeofday(&tv);
#else
gettimeofday(&tv, 0);
#endif
- tm = localtime(&tv.tv_sec);
+ t = tv.tv_sec;
+ tm = localtime(&t);
today = *tm;