]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
another-time_t-pointer-bug-20060320
authorJeffrey Altman <jaltman@secure-endpoints.com>
Mon, 20 Mar 2006 13:25:50 +0000 (13:25 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Mon, 20 Mar 2006 13:25:50 +0000 (13:25 +0000)
do not pass pointers to 32-bit values as pointers to 64-bit values.
this results in memory corruption

src/util/kreltime.c

index abfe9c08d8ad8f9fcbffd272905090d94944d608..4edb8e9c85bc82cca892671f60337a558617a75c 100644 (file)
@@ -115,8 +115,9 @@ int
 ktimeDate_FromInt32(afs_int32 timeSecs, struct ktime_date *ktimePtr)
 {
     struct tm *timePtr;
+    time_t     tt = timeSecs;
 
-    timePtr = localtime((time_t *) & timeSecs);
+    timePtr = localtime(&tt);
 
     /* copy the relevant fields */
     ktimePtr->sec = timePtr->tm_sec;