fix CL_ENGINE_DB_TIME, time_t may well be 64-bits, so

writing only 32-bits will leave upper 32-bits undefined and lead to funny
results, such as VERSION command working first time, but 2nd time not showing
the DB timestamp.

git-svn: trunk@4637
remotes/push_mirror/0.95
Török Edvin 17 years ago
parent 8f3337f155
commit 17799de206
  1. 8
      ChangeLog
  2. 2
      libclamav/clamav.h
  3. 3
      libclamav/others.c

@ -1,3 +1,11 @@
Fri Jan 23 13:33:18 EET 2009 (edwin)
------------------------------------
* libclamav/clamav.h, libclamav/others.c, libclamav/others.h: fix
CL_ENGINE_DB_TIME, time_t may well be 64-bits, so writing only
32-bits will leave upper 32-bits undefined and lead to funny
results, such as VERSION command working first time, but 2nd time
not showing the DB timestamp.
Thu Jan 22 15:59:43 CET 2009 (tk)
---------------------------------
* clamconf: handle --version/-V

@ -119,7 +119,7 @@ enum cl_engine_field {
CL_ENGINE_MIN_SSN_COUNT, /* uint32_t */
CL_ENGINE_PUA_CATEGORIES, /* (char *) */
CL_ENGINE_DB_VERSION, /* uint32_t */
CL_ENGINE_DB_TIME, /* uint32_t */
CL_ENGINE_DB_TIME, /* time_t */
CL_ENGINE_AC_ONLY, /* uint32_t */
CL_ENGINE_AC_MINDEPTH, /* uint32_t */
CL_ENGINE_AC_MAXDEPTH, /* uint32_t */

@ -350,7 +350,8 @@ int cl_engine_get(const struct cl_engine *engine, enum cl_engine_field field, vo
*((uint32_t *) val) = engine->dbversion[0];
break;
case CL_ENGINE_DB_TIME:
*((uint32_t *) val) = engine->dbversion[1];
/* time_t may be 64-bit! */
*((time_t *) val) = engine->dbversion[1];
break;
case CL_ENGINE_AC_ONLY:
*((uint32_t *) val) = engine->ac_only;

Loading…
Cancel
Save