samba-vscan/kaspersky/libkavdc libkavdc.c,1.2.2.2,1.2.2.3
Rainer Link <[email protected]> Thu, 29 Jul 2004 19:44:14 +0000
| Newsgroups | gmane.comp.security.virus.openantivirus.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/openantivirus/samba-vscan/kaspersky/libkavdc
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10878
Modified Files:
Tag: VSCAN_0_3
libkavdc.c
Log Message:
avoid "ERROR: string overflow by 1 (16 - 15) in safe_strcpy"
Index: libkavdc.c
===================================================================
RCS file: /cvsroot/openantivirus/samba-vscan/kaspersky/libkavdc/libkavdc.c,v
retrieving revision 1.2.2.2
retrieving revision 1.2.2.3
diff -u -d -r1.2.2.2 -r1.2.2.3
--- libkavdc.c 12 Mar 2004 22:47:38 -0000 1.2.2.2
+++ libkavdc.c 29 Jul 2004 19:44:12 -0000 1.2.2.3
@@ -687,13 +687,20 @@
}
}
+/*getDate() - returns a pointer to 16-char string(16th is 0),
+ representing current date and time*/
static char* getDate()
{
char* date;
time_t t;
time(&t);
date=(char*)malloc(16);
- strncpy(date,ctime(&t)+4,15);
+/* strncpy(date,ctime(&t)+4,15);
+ strncpy is re-defined as safe_strcpy by Samba. This function
+ checks the length of date string (which is 16), but only 15 chars
+ are copied. So, the "ERROR: string overflow by 1 (16 - 15) in safe_strcpy"
+ is logged. reniar, 03.07.2004 */
+ memmove(date,ctime(&t)+4,15);
date[15]=0;
return date;
}
-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com