Browse code

libclamav/cvd.c: fix warning when cvd timestamp is in the future (bb#1381)

git-svn: trunk@4731

Tomasz Kojm authored on 2009/02/11 18:40:23
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Wed Feb 11 11:08:55 CET 2009 (tk)
2
+---------------------------------
3
+ * libclamav/cvd.c: fix warning when cvd timestamp is in the future (bb#1381)
4
+
1 5
 Wed Feb 11 09:38:19 CET 2009 (tk)
2 6
 ---------------------------------
3 7
  * libclamav/filetypes_int.h: sync with daily.ftm
... ...
@@ -519,7 +519,14 @@ int cli_cvdload(FILE *fs, struct cl_engine *engine, unsigned int *signo, unsigne
519 519
 
520 520
     if(cvd.stime && daily) {
521 521
 	time(&s_time);
522
-	if((int) s_time - cvd.stime > 604800) {
522
+	if(cvd.stime > s_time) {
523
+	    if(cvd.stime - (unsigned int ) s_time > 3600) {
524
+		cli_warnmsg("******************************************************\n");
525
+		cli_warnmsg("***      Virus database timestamp in the future!   ***\n");
526
+		cli_warnmsg("***  Please check the timezone and clock settings  ***\n");
527
+		cli_warnmsg("******************************************************\n");
528
+	    }
529
+	} else if((unsigned int) s_time - cvd.stime > 604800) {
523 530
 	    cli_warnmsg("**************************************************\n");
524 531
 	    cli_warnmsg("***  The virus database is older than 7 days!  ***\n");
525 532
 	    cli_warnmsg("***   Please update it as soon as possible.    ***\n");