[Pkg-clamav-commits] [SCM] Debian repository for ClamAV branch, debian/unstable, updated. 99ae9353f6834da0cb73f59f4b32d1f0ae1263fa
Stephen Gran
steve at lobefin.net
Thu Sep 4 12:37:08 UTC 2008
The following commit has been merged in the debian/unstable branch:
commit fad495ad2e3425775b384e9b8315cb76d622f538
Author: Stephen Gran <steve at lobefin.net>
Date: Thu Sep 4 13:25:55 2008 +0100
Revert "check ctime return value (bb #869)."
This reverts commit 60029b157f78baa845de62f49bd4827900636ae0.
diff --git a/ChangeLog b/ChangeLog
index 9ac0d78..7ca34d7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,3 @@
-Mon Mar 17 16:43:23 EET 2008 (edwin)
------------------------------------
- * libclamav/others.c: check ctime return value (bb #869).
-
Mon Mar 10 19:40:25 CET 2008 (acab)
-----------------------------------
* libclamav/nsis: unpack broken files too - bb#873
diff --git a/libclamav/others.c b/libclamav/others.c
index fb3f345..58fcd3e 100644
--- a/libclamav/others.c
+++ b/libclamav/others.c
@@ -901,49 +901,33 @@ int cli_bitset_test(bitset_t *bs, unsigned long bit_offset)
return (bs->bitset[char_offset] & ((unsigned char)1 << bit_offset));
}
-/* returns converted timestamp, in case of error the returned string contains at least one character */
const char* cli_ctime(const time_t *timep, char *buf, const size_t bufsize)
{
- const char *ret;
if(bufsize < 26) {
/* standard says we must have at least 26 bytes buffer */
cli_warnmsg("buffer too small for ctime\n");
- return " ";
- }
- if((uint32_t)(*timep) > 0x7fffffff) {
- /* some systems can consider these timestamps invalid */
- strncpy(buf, "invalid timestamp", bufsize-1);
- buf[bufsize-1] = '\0';
- return buf;
+ return NULL;
}
-
#ifdef HAVE_CTIME_R
# ifdef HAVE_CTIME_R_2
- ret = ctime_r(timep, buf);
+ {
+ char* y = ctime_r(timep, buf);
+ return y;
+ }
# else
- ret = ctime_r(timep, buf, bufsize);
+ return ctime_r(timep, buf, bufsize);
# endif
#else /* no ctime_r */
# ifdef CL_THREAD_SAFE
pthread_mutex_lock(&cli_ctime_mutex);
# endif
- ret = ctime(timep);
- if(ret) {
- strncpy(buf, ret, bufsize-1);
- buf[bufsize-1] = '\0';
- ret = buf;
- }
+ strncpy(buf, ctime(timep), bufsize-1);
+ buf[bufsize-1] = '\0';
# ifdef CL_THREAD_SAFE
pthread_mutex_unlock(&cli_ctime_mutex);
# endif
+ return buf;
#endif
- /* common */
- if(!ret) {
- buf[0] = ' ';
- buf[1] = '\0';
- return buf;
- }
- return ret;
}
--
Debian repository for ClamAV
More information about the Pkg-clamav-commits
mailing list