reverse strlcpy/strlcat patch

git-svn: trunk@477
remotes/push_mirror/metadata
Tomasz Kojm 22 years ago
parent db1cae229c
commit 658f19f860
  1. 4
      clamav-devel/ChangeLog
  2. 2
      clamav-devel/clamav-milter/Makefile.am
  3. 25
      clamav-devel/clamav-milter/Makefile.in
  4. 12
      clamav-devel/clamav-milter/clamav-milter.c
  5. 2
      clamav-devel/clamd/Makefile.am
  6. 40
      clamav-devel/clamd/Makefile.in
  7. 5
      clamav-devel/clamd/dazukoio.c
  8. 7
      clamav-devel/clamd/dazukoio_compat12.c
  9. 3
      clamav-devel/clamd/localserver.c
  10. 5
      clamav-devel/clamd/options.c
  11. 2
      clamav-devel/clamdscan/Makefile.am
  12. 28
      clamav-devel/clamdscan/Makefile.in
  13. 3
      clamav-devel/clamdscan/client.c
  14. 2
      clamav-devel/clamscan/Makefile.am
  15. 29
      clamav-devel/clamscan/Makefile.in
  16. 5
      clamav-devel/clamscan/manager.c
  17. 5
      clamav-devel/clamscan/options.c
  18. 2
      clamav-devel/freshclam/Makefile.am
  19. 29
      clamav-devel/freshclam/Makefile.in
  20. 2
      clamav-devel/freshclam/notify.c
  21. 4
      clamav-devel/freshclam/options.c
  22. 2
      clamav-devel/libclamav/Makefile.am
  23. 2
      clamav-devel/libclamav/Makefile.in
  24. 7
      clamav-devel/libclamav/cvd.c
  25. 3
      clamav-devel/libclamav/others.c
  26. 3
      clamav-devel/libclamav/readdb.c
  27. 4
      clamav-devel/libclamav/str.c
  28. 5
      clamav-devel/libclamav/unrarlib.c
  29. 7
      clamav-devel/libclamav/zziplib/zzip-dir.c
  30. 3
      clamav-devel/shared/cfgparser.c
  31. 3
      clamav-devel/shared/output.c
  32. 2
      clamav-devel/sigtool/Makefile.am
  33. 26
      clamav-devel/sigtool/Makefile.in
  34. 5
      clamav-devel/sigtool/options.c
  35. 25
      clamav-devel/sigtool/sigtool.c

@ -1,3 +1,7 @@
Wed Apr 7 00:51:11 CEST 2004 (tk)
----------------------------------
* reverse the last patch
Tue Apr 6 14:19:16 CEST 2004 (tk)
----------------------------------
* global hardening patch: use strlcpy/strlcat instead of strncpy/strncat

@ -28,8 +28,6 @@ clamav_milter_SOURCES = \
$(top_srcdir)/shared/getopt.h \
$(top_srcdir)/shared/memory.c \
$(top_srcdir)/shared/memory.h \
$(top_srcdir)/shared/strutil.c \
$(top_srcdir)/shared/strutil.h \
clamav-milter.c
man_MANS = $(top_srcdir)/docs/man/clamav-milter.8

@ -127,8 +127,6 @@ install_sh = @install_sh@
@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@ $(top_srcdir)/shared/getopt.h \
@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@ $(top_srcdir)/shared/memory.c \
@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@ $(top_srcdir)/shared/memory.h \
@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@ $(top_srcdir)/shared/strutil.c \
@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@ $(top_srcdir)/shared/strutil.h \
@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@ clamav-milter.c
@ -154,7 +152,6 @@ PROGRAMS = $(sbin_PROGRAMS)
@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@ cfgparser.$(OBJEXT) \
@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@ getopt.$(OBJEXT) \
@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@ memory.$(OBJEXT) \
@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@ strutil.$(OBJEXT) \
@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@ clamav-milter.$(OBJEXT)
clamav_milter_OBJECTS = $(am_clamav_milter_OBJECTS)
clamav_milter_LDADD = $(LDADD)
@ -167,7 +164,7 @@ depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/cfgparser.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/clamav-milter.Po ./$(DEPDIR)/getopt.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/memory.Po ./$(DEPDIR)/strutil.Po
@AMDEP_TRUE@ ./$(DEPDIR)/memory.Po
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \
@ -222,7 +219,6 @@ clean-sbinPROGRAMS:
cfgparser.$(OBJEXT): $(top_srcdir)/shared/cfgparser.c
getopt.$(OBJEXT): $(top_srcdir)/shared/getopt.c
memory.$(OBJEXT): $(top_srcdir)/shared/memory.c
strutil.$(OBJEXT): $(top_srcdir)/shared/strutil.c
clamav-milter$(EXEEXT): $(clamav_milter_OBJECTS) $(clamav_milter_DEPENDENCIES)
@rm -f clamav-milter$(EXEEXT)
$(LINK) $(clamav_milter_LDFLAGS) $(clamav_milter_OBJECTS) $(clamav_milter_LDADD) $(LIBS)
@ -237,7 +233,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clamav-milter.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memory.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strutil.Po@am__quote@
distclean-depend:
-rm -rf ./$(DEPDIR)
@ -313,24 +308,6 @@ memory.lo: $(top_srcdir)/shared/memory.c
@AMDEP_TRUE@ depfile='$(DEPDIR)/memory.Plo' tmpdepfile='$(DEPDIR)/memory.TPlo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o memory.lo `test -f '$(top_srcdir)/shared/memory.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/memory.c
strutil.o: $(top_srcdir)/shared/strutil.c
@AMDEP_TRUE@ source='$(top_srcdir)/shared/strutil.c' object='strutil.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/strutil.Po' tmpdepfile='$(DEPDIR)/strutil.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strutil.o `test -f '$(top_srcdir)/shared/strutil.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/strutil.c
strutil.obj: $(top_srcdir)/shared/strutil.c
@AMDEP_TRUE@ source='$(top_srcdir)/shared/strutil.c' object='strutil.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/strutil.Po' tmpdepfile='$(DEPDIR)/strutil.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strutil.obj `cygpath -w $(top_srcdir)/shared/strutil.c`
strutil.lo: $(top_srcdir)/shared/strutil.c
@AMDEP_TRUE@ source='$(top_srcdir)/shared/strutil.c' object='strutil.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/strutil.Plo' tmpdepfile='$(DEPDIR)/strutil.TPlo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strutil.lo `test -f '$(top_srcdir)/shared/strutil.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/strutil.c
CCDEPMODE = @CCDEPMODE@
mostlyclean-libtool:

@ -317,6 +317,9 @@
*
* Change History:
* $Log: clamav-milter.c,v $
* Revision 1.70 2004/04/06 22:43:43 kojm
* reverse strlcpy/strlcat patch
*
* Revision 1.69 2004/04/06 12:14:52 kojm
* use strlcpy/strlcat
*
@ -509,7 +512,7 @@
* Revision 1.6 2003/09/28 16:37:23 nigelhorne
* Added -f flag use MaxThreads if --max-children not set
*/
static char const rcsid[] = "$Id: clamav-milter.c,v 1.69 2004/04/06 12:14:52 kojm Exp $";
static char const rcsid[] = "$Id: clamav-milter.c,v 1.70 2004/04/06 22:43:43 kojm Exp $";
#define CM_VERSION "0.70g"
@ -525,7 +528,6 @@ static char const rcsid[] = "$Id: clamav-milter.c,v 1.69 2004/04/06 12:14:52 koj
#include "str.h"
#include "../libclamav/others.h"
#include "clamav.h"
#include "strutil.h"
#ifndef CL_DEBUG
#define NDEBUG
@ -1299,7 +1301,7 @@ pingServer(int serverNumber)
memset((char *)&server, 0, sizeof(struct sockaddr_un));
server.sun_family = AF_UNIX;
strlcpy(server.sun_path, localSocket, sizeof(server.sun_path));
strncpy(server.sun_path, localSocket, sizeof(server.sun_path));
if((sock = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) {
perror("socket");
@ -1912,7 +1914,7 @@ clamfi_eom(SMFICTX *ctx)
memset((char *)&server, 0, sizeof(struct sockaddr_un));
server.sun_family = AF_UNIX;
strlcpy(server.sun_path, localSocket, sizeof(server.sun_path));
strncpy(server.sun_path, localSocket, sizeof(server.sun_path));
if((privdata->cmdSocket = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) {
perror("socket");
@ -2583,7 +2585,7 @@ connect2clamd(struct privdata *privdata)
memset((char *)&server, 0, sizeof(struct sockaddr_un));
server.sun_family = AF_UNIX;
strlcpy(server.sun_path, localSocket, sizeof(server.sun_path));
strncpy(server.sun_path, localSocket, sizeof(server.sun_path));
if((privdata->cmdSocket = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) {
perror("socket");

@ -28,8 +28,6 @@ clamd_SOURCES = \
$(top_srcdir)/shared/getopt.h \
$(top_srcdir)/shared/memory.c \
$(top_srcdir)/shared/memory.h \
$(top_srcdir)/shared/strutil.c \
$(top_srcdir)/shared/strutil.h \
options.c \
options.h \
clamd.c \

@ -127,8 +127,6 @@ install_sh = @install_sh@
@BUILD_CLAMD_TRUE@ $(top_srcdir)/shared/getopt.h \
@BUILD_CLAMD_TRUE@ $(top_srcdir)/shared/memory.c \
@BUILD_CLAMD_TRUE@ $(top_srcdir)/shared/memory.h \
@BUILD_CLAMD_TRUE@ $(top_srcdir)/shared/strutil.c \
@BUILD_CLAMD_TRUE@ $(top_srcdir)/shared/strutil.h \
@BUILD_CLAMD_TRUE@ options.c \
@BUILD_CLAMD_TRUE@ options.h \
@BUILD_CLAMD_TRUE@ clamd.c \
@ -173,13 +171,12 @@ PROGRAMS = $(sbin_PROGRAMS)
@BUILD_CLAMD_TRUE@am_clamd_OBJECTS = output.$(OBJEXT) \
@BUILD_CLAMD_TRUE@ cfgparser.$(OBJEXT) getopt.$(OBJEXT) \
@BUILD_CLAMD_TRUE@ memory.$(OBJEXT) strutil.$(OBJEXT) \
@BUILD_CLAMD_TRUE@ options.$(OBJEXT) clamd.$(OBJEXT) \
@BUILD_CLAMD_TRUE@ tcpserver.$(OBJEXT) localserver.$(OBJEXT) \
@BUILD_CLAMD_TRUE@ session.$(OBJEXT) thrmgr.$(OBJEXT) \
@BUILD_CLAMD_TRUE@ server-th.$(OBJEXT) scanner.$(OBJEXT) \
@BUILD_CLAMD_TRUE@ others.$(OBJEXT) clamuko.$(OBJEXT) \
@BUILD_CLAMD_TRUE@ dazukoio_compat12.$(OBJEXT) \
@BUILD_CLAMD_TRUE@ memory.$(OBJEXT) options.$(OBJEXT) \
@BUILD_CLAMD_TRUE@ clamd.$(OBJEXT) tcpserver.$(OBJEXT) \
@BUILD_CLAMD_TRUE@ localserver.$(OBJEXT) session.$(OBJEXT) \
@BUILD_CLAMD_TRUE@ thrmgr.$(OBJEXT) server-th.$(OBJEXT) \
@BUILD_CLAMD_TRUE@ scanner.$(OBJEXT) others.$(OBJEXT) \
@BUILD_CLAMD_TRUE@ clamuko.$(OBJEXT) dazukoio_compat12.$(OBJEXT) \
@BUILD_CLAMD_TRUE@ dazukoio.$(OBJEXT) tests.$(OBJEXT)
clamd_OBJECTS = $(am_clamd_OBJECTS)
clamd_LDADD = $(LDADD)
@ -197,9 +194,8 @@ am__depfiles_maybe = depfiles
@AMDEP_TRUE@ ./$(DEPDIR)/memory.Po ./$(DEPDIR)/options.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/others.Po ./$(DEPDIR)/output.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/scanner.Po ./$(DEPDIR)/server-th.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/session.Po ./$(DEPDIR)/strutil.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/tcpserver.Po ./$(DEPDIR)/tests.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/thrmgr.Po
@AMDEP_TRUE@ ./$(DEPDIR)/session.Po ./$(DEPDIR)/tcpserver.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/tests.Po ./$(DEPDIR)/thrmgr.Po
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \
@ -252,7 +248,6 @@ output.$(OBJEXT): $(top_srcdir)/shared/output.c
cfgparser.$(OBJEXT): $(top_srcdir)/shared/cfgparser.c
getopt.$(OBJEXT): $(top_srcdir)/shared/getopt.c
memory.$(OBJEXT): $(top_srcdir)/shared/memory.c
strutil.$(OBJEXT): $(top_srcdir)/shared/strutil.c
clamd$(EXEEXT): $(clamd_OBJECTS) $(clamd_DEPENDENCIES)
@rm -f clamd$(EXEEXT)
$(LINK) $(clamd_LDFLAGS) $(clamd_OBJECTS) $(clamd_LDADD) $(LIBS)
@ -277,7 +272,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scanner.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/server-th.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/session.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strutil.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tcpserver.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/thrmgr.Po@am__quote@
@ -374,24 +368,6 @@ memory.lo: $(top_srcdir)/shared/memory.c
@AMDEP_TRUE@ depfile='$(DEPDIR)/memory.Plo' tmpdepfile='$(DEPDIR)/memory.TPlo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o memory.lo `test -f '$(top_srcdir)/shared/memory.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/memory.c
strutil.o: $(top_srcdir)/shared/strutil.c
@AMDEP_TRUE@ source='$(top_srcdir)/shared/strutil.c' object='strutil.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/strutil.Po' tmpdepfile='$(DEPDIR)/strutil.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strutil.o `test -f '$(top_srcdir)/shared/strutil.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/strutil.c
strutil.obj: $(top_srcdir)/shared/strutil.c
@AMDEP_TRUE@ source='$(top_srcdir)/shared/strutil.c' object='strutil.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/strutil.Po' tmpdepfile='$(DEPDIR)/strutil.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strutil.obj `cygpath -w $(top_srcdir)/shared/strutil.c`
strutil.lo: $(top_srcdir)/shared/strutil.c
@AMDEP_TRUE@ source='$(top_srcdir)/shared/strutil.c' object='strutil.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/strutil.Plo' tmpdepfile='$(DEPDIR)/strutil.TPlo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strutil.lo `test -f '$(top_srcdir)/shared/strutil.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/strutil.c
CCDEPMODE = @CCDEPMODE@
mostlyclean-libtool:

@ -46,7 +46,6 @@
#include "dazukoio_xp.h"
#include "dazukoio.h"
#include "others.h"
#include "strutil.h"
#if !defined(NO_COMPAT12)
#include "dazukoio_compat12.h"
@ -174,12 +173,12 @@ int dazukoRegister_TS(dazuko_id_t **dazuko_id, const char *groupName, const char
if (strcasecmp(mode, "r") == 0)
{
strlcpy(regMode, "R", sizeof(regMode));
strncpy(regMode, "R", sizeof(regMode));
write_mode = 0;
}
else if (strcasecmp(mode, "r+") == 0 || strcasecmp(mode, "rw") == 0)
{
strlcpy(regMode, "RW", sizeof(regMode));
strncpy(regMode, "RW", sizeof(regMode));
write_mode = 1;
}
else

@ -47,7 +47,6 @@
#include <unistd.h>
#include <sys/ioctl.h>
#include "dazukoio_compat12.h"
#include "strutil.h"
int dazukoRegister_TS_compat12_wrapper(struct dazuko_id **dazuko_id, const char *groupName)
{
@ -117,7 +116,7 @@ int dazukoRegister_TS_compat12(struct dazuko_id *dazuko, const char *groupName)
memset(opt, 0, sizeof(struct option_compat12));
opt->command = REGISTER;
strlcpy(opt->buffer, groupName, sizeof(opt->buffer));
strncpy(opt->buffer, groupName, sizeof(opt->buffer) - 1);
opt->buffer_length = strlen(opt->buffer) + 1;
if (ioctl(dazuko->device, _IOW(dazuko->dev_major, IOCTL_SET_OPTION, void *), opt) != 0)
@ -187,7 +186,7 @@ int dazuko_set_path_compat12(struct dazuko_id *dazuko, const char *path, int com
memset(opt, 0, sizeof(struct option_compat12));
opt->command = command;
strlcpy(opt->buffer, path, sizeof(opt->buffer));
strncpy(opt->buffer, path, sizeof(opt->buffer) - 1);
opt->buffer_length = strlen(opt->buffer) + 1;
if (ioctl(dazuko->device, _IOW(dazuko->dev_major, IOCTL_SET_OPTION, void *), opt) != 0)
@ -324,7 +323,7 @@ int dazukoReturnAccess_TS_compat12_wrapper(struct dazuko_id *dazuko, struct dazu
acc_compat12.pid = (*acc)->pid;
if ((*acc)->filename != NULL)
{
strlcpy(acc_compat12.filename, (*acc)->filename, sizeof(acc_compat12.filename));
strncpy(acc_compat12.filename, (*acc)->filename, sizeof(acc_compat12.filename) - 1);
acc_compat12.filename[sizeof(acc_compat12.filename) - 1] = 0;
}

@ -35,7 +35,6 @@
#include "others.h"
#include "server.h"
#include "output.h"
#include "strutil.h"
int localserver(const struct optstruct *opt, const struct cfgstruct *copt, struct cl_node *root)
{
@ -47,7 +46,7 @@ int localserver(const struct optstruct *opt, const struct cfgstruct *copt, struc
memset((char *) &server, 0, sizeof(server));
server.sun_family = AF_UNIX;
strlcpy(server.sun_path, cfgopt(copt, "LocalSocket")->strarg, sizeof(server.sun_path));
strncpy(server.sun_path, cfgopt(copt, "LocalSocket")->strarg, sizeof(server.sun_path));
if((sockfd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) {
estr = strerror(errno);

@ -37,7 +37,6 @@
#include "others.h"
#include "../libclamav/others.h"
#include "memory.h"
#include "strutil.h"
void clamd(struct optstruct *opt);
@ -105,9 +104,9 @@ int main(int argc, char **argv)
opt->filename=(char*)mcalloc(len + 256, sizeof(char));
for(i=optind; i<argc; i++) {
strlcat(opt->filename, argv[i], len+256);
strncat(opt->filename, argv[i], strlen(argv[i]));
if(i != argc-1)
strlcat(opt->filename, " ", len+256);
strncat(opt->filename, " ", 1);
}
}

@ -26,8 +26,6 @@ clamdscan_SOURCES = \
$(top_srcdir)/shared/cfgparser.h \
$(top_srcdir)/shared/memory.c \
$(top_srcdir)/shared/memory.h \
$(top_srcdir)/shared/strutil.c \
$(top_srcdir)/shared/strutil.h \
clamdscan.c \
client.c \
client.h \

@ -125,8 +125,6 @@ install_sh = @install_sh@
@BUILD_CLAMD_TRUE@ $(top_srcdir)/shared/cfgparser.h \
@BUILD_CLAMD_TRUE@ $(top_srcdir)/shared/memory.c \
@BUILD_CLAMD_TRUE@ $(top_srcdir)/shared/memory.h \
@BUILD_CLAMD_TRUE@ $(top_srcdir)/shared/strutil.c \
@BUILD_CLAMD_TRUE@ $(top_srcdir)/shared/strutil.h \
@BUILD_CLAMD_TRUE@ clamdscan.c \
@BUILD_CLAMD_TRUE@ client.c \
@BUILD_CLAMD_TRUE@ client.h \
@ -147,8 +145,7 @@ PROGRAMS = $(bin_PROGRAMS)
@BUILD_CLAMD_TRUE@am_clamdscan_OBJECTS = output.$(OBJEXT) \
@BUILD_CLAMD_TRUE@ cfgparser.$(OBJEXT) memory.$(OBJEXT) \
@BUILD_CLAMD_TRUE@ strutil.$(OBJEXT) clamdscan.$(OBJEXT) \
@BUILD_CLAMD_TRUE@ client.$(OBJEXT)
@BUILD_CLAMD_TRUE@ clamdscan.$(OBJEXT) client.$(OBJEXT)
clamdscan_OBJECTS = $(am_clamdscan_OBJECTS)
@BUILD_CLAMD_TRUE@clamdscan_DEPENDENCIES = \
@BUILD_CLAMD_TRUE@ $(top_builddir)/clamscan/options.o \
@ -164,8 +161,7 @@ depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/cfgparser.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/clamdscan.Po ./$(DEPDIR)/client.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/memory.Po ./$(DEPDIR)/output.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/strutil.Po
@AMDEP_TRUE@ ./$(DEPDIR)/memory.Po ./$(DEPDIR)/output.Po
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \
@ -217,7 +213,6 @@ clean-binPROGRAMS:
output.$(OBJEXT): $(top_srcdir)/shared/output.c
cfgparser.$(OBJEXT): $(top_srcdir)/shared/cfgparser.c
memory.$(OBJEXT): $(top_srcdir)/shared/memory.c
strutil.$(OBJEXT): $(top_srcdir)/shared/strutil.c
clamdscan$(EXEEXT): $(clamdscan_OBJECTS) $(clamdscan_DEPENDENCIES)
@rm -f clamdscan$(EXEEXT)
$(LINK) $(clamdscan_LDFLAGS) $(clamdscan_OBJECTS) $(clamdscan_LDADD) $(LIBS)
@ -233,7 +228,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/client.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memory.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/output.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strutil.Po@am__quote@
distclean-depend:
-rm -rf ./$(DEPDIR)
@ -309,24 +303,6 @@ memory.lo: $(top_srcdir)/shared/memory.c
@AMDEP_TRUE@ depfile='$(DEPDIR)/memory.Plo' tmpdepfile='$(DEPDIR)/memory.TPlo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o memory.lo `test -f '$(top_srcdir)/shared/memory.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/memory.c
strutil.o: $(top_srcdir)/shared/strutil.c
@AMDEP_TRUE@ source='$(top_srcdir)/shared/strutil.c' object='strutil.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/strutil.Po' tmpdepfile='$(DEPDIR)/strutil.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strutil.o `test -f '$(top_srcdir)/shared/strutil.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/strutil.c
strutil.obj: $(top_srcdir)/shared/strutil.c
@AMDEP_TRUE@ source='$(top_srcdir)/shared/strutil.c' object='strutil.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/strutil.Po' tmpdepfile='$(DEPDIR)/strutil.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strutil.obj `cygpath -w $(top_srcdir)/shared/strutil.c`
strutil.lo: $(top_srcdir)/shared/strutil.c
@AMDEP_TRUE@ source='$(top_srcdir)/shared/strutil.c' object='strutil.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/strutil.Plo' tmpdepfile='$(DEPDIR)/strutil.TPlo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strutil.lo `test -f '$(top_srcdir)/shared/strutil.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/strutil.c
CCDEPMODE = @CCDEPMODE@
mostlyclean-libtool:

@ -38,7 +38,6 @@
#include "cfgparser.h"
#include "memory.h"
#include "output.h"
#include "strutil.h"
#ifdef PF_INET
# define SOCKET_INET PF_INET
@ -79,7 +78,7 @@ int client(const struct optstruct *opt)
} else if((cpt = cfgopt(copt, "LocalSocket"))) {
server.sun_family = AF_UNIX;
strlcpy(server.sun_path, cpt->strarg, sizeof(server.sun_path));
strncpy(server.sun_path, cpt->strarg, sizeof(server.sun_path));
if((sockd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) {
perror("socket()");

@ -25,8 +25,6 @@ clamscan_SOURCES = \
$(top_srcdir)/shared/getopt.h \
$(top_srcdir)/shared/memory.c \
$(top_srcdir)/shared/memory.h \
$(top_srcdir)/shared/strutil.c \
$(top_srcdir)/shared/strutil.h \
clamscan.c \
options.c \
options.h \

@ -126,8 +126,6 @@ clamscan_SOURCES = \
$(top_srcdir)/shared/getopt.h \
$(top_srcdir)/shared/memory.c \
$(top_srcdir)/shared/memory.h \
$(top_srcdir)/shared/strutil.c \
$(top_srcdir)/shared/strutil.h \
clamscan.c \
options.c \
options.h \
@ -152,8 +150,8 @@ bin_PROGRAMS = clamscan$(EXEEXT)
PROGRAMS = $(bin_PROGRAMS)
am_clamscan_OBJECTS = output.$(OBJEXT) getopt.$(OBJEXT) memory.$(OBJEXT) \
strutil.$(OBJEXT) clamscan.$(OBJEXT) options.$(OBJEXT) \
others.$(OBJEXT) manager.$(OBJEXT) treewalk.$(OBJEXT)
clamscan.$(OBJEXT) options.$(OBJEXT) others.$(OBJEXT) \
manager.$(OBJEXT) treewalk.$(OBJEXT)
clamscan_OBJECTS = $(am_clamscan_OBJECTS)
clamscan_LDADD = $(LDADD)
clamscan_DEPENDENCIES =
@ -166,8 +164,7 @@ am__depfiles_maybe = depfiles
@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/clamscan.Po ./$(DEPDIR)/getopt.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/manager.Po ./$(DEPDIR)/memory.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/options.Po ./$(DEPDIR)/others.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/output.Po ./$(DEPDIR)/strutil.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/treewalk.Po
@AMDEP_TRUE@ ./$(DEPDIR)/output.Po ./$(DEPDIR)/treewalk.Po
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \
@ -219,7 +216,6 @@ clean-binPROGRAMS:
output.$(OBJEXT): $(top_srcdir)/shared/output.c
getopt.$(OBJEXT): $(top_srcdir)/shared/getopt.c
memory.$(OBJEXT): $(top_srcdir)/shared/memory.c
strutil.$(OBJEXT): $(top_srcdir)/shared/strutil.c
clamscan$(EXEEXT): $(clamscan_OBJECTS) $(clamscan_DEPENDENCIES)
@rm -f clamscan$(EXEEXT)
$(LINK) $(clamscan_LDFLAGS) $(clamscan_OBJECTS) $(clamscan_LDADD) $(LIBS)
@ -237,7 +233,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/options.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/others.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/output.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strutil.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/treewalk.Po@am__quote@
distclean-depend:
@ -314,24 +309,6 @@ memory.lo: $(top_srcdir)/shared/memory.c
@AMDEP_TRUE@ depfile='$(DEPDIR)/memory.Plo' tmpdepfile='$(DEPDIR)/memory.TPlo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o memory.lo `test -f '$(top_srcdir)/shared/memory.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/memory.c
strutil.o: $(top_srcdir)/shared/strutil.c
@AMDEP_TRUE@ source='$(top_srcdir)/shared/strutil.c' object='strutil.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/strutil.Po' tmpdepfile='$(DEPDIR)/strutil.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strutil.o `test -f '$(top_srcdir)/shared/strutil.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/strutil.c
strutil.obj: $(top_srcdir)/shared/strutil.c
@AMDEP_TRUE@ source='$(top_srcdir)/shared/strutil.c' object='strutil.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/strutil.Po' tmpdepfile='$(DEPDIR)/strutil.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strutil.obj `cygpath -w $(top_srcdir)/shared/strutil.c`
strutil.lo: $(top_srcdir)/shared/strutil.c
@AMDEP_TRUE@ source='$(top_srcdir)/shared/strutil.c' object='strutil.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/strutil.Plo' tmpdepfile='$(DEPDIR)/strutil.TPlo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strutil.lo `test -f '$(top_srcdir)/shared/strutil.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/strutil.c
CCDEPMODE = @CCDEPMODE@
mostlyclean-libtool:

@ -49,7 +49,6 @@
#include "strrcpy.h"
#include "memory.h"
#include "output.h"
#include "strutil.h"
#ifdef C_LINUX
dev_t procdev;
@ -134,7 +133,7 @@ int scanmanager(const struct optstruct *opt)
ptr = getargl(opt, "max-space");
if(tolower(ptr[strlen(ptr) - 1]) == 'm') {
cpy = mcalloc(strlen(ptr), sizeof(char));
strlcpy(cpy, ptr, strlen(ptr));
strncpy(cpy, ptr, strlen(ptr) - 1);
limits->maxfilesize = atoi(cpy) * 1024 * 1024;
free(cpy);
} else
@ -843,7 +842,7 @@ int clamav_unpack(const char *prog, char **args, const char *tmpdir, const struc
ptr = getargl(opt, "max-space");
if(tolower(ptr[strlen(ptr) - 1]) == 'm') { /* megabytes */
cpy = mcalloc(strlen(ptr), sizeof(char));
strlcpy(cpy, ptr, strlen(ptr));
strncpy(cpy, ptr, strlen(ptr) - 1);
maxspace = atoi(cpy) * 1024;
free(cpy);
} else /* default - kilobytes */

@ -35,7 +35,6 @@
#include "shared.h"
#include "memory.h"
#include "output.h"
#include "strutil.h"
extern int clamscan(struct optstruct *opt);
@ -139,9 +138,9 @@ int main(int argc, char **argv)
opt->filename=(char*)mcalloc(len + 256, sizeof(char));
for(i=optind; i<argc; i++) {
strlcat(opt->filename, argv[i], len+256);
strncat(opt->filename, argv[i], strlen(argv[i]));
if(i != argc-1)
strlcat(opt->filename, "\t", len+256);
strncat(opt->filename, "\t", 1);
}
}

@ -27,8 +27,6 @@ freshclam_SOURCES = \
$(top_srcdir)/shared/getopt.h \
$(top_srcdir)/shared/memory.c \
$(top_srcdir)/shared/memory.h \
$(top_srcdir)/shared/strutil.c \
$(top_srcdir)/shared/strutil.h \
freshclam.c \
freshclam.h \
options.c \

@ -128,8 +128,6 @@ freshclam_SOURCES = \
$(top_srcdir)/shared/getopt.h \
$(top_srcdir)/shared/memory.c \
$(top_srcdir)/shared/memory.h \
$(top_srcdir)/shared/strutil.c \
$(top_srcdir)/shared/strutil.h \
freshclam.c \
freshclam.h \
options.c \
@ -152,9 +150,8 @@ bin_PROGRAMS = freshclam$(EXEEXT)
PROGRAMS = $(bin_PROGRAMS)
am_freshclam_OBJECTS = output.$(OBJEXT) cfgparser.$(OBJEXT) \
getopt.$(OBJEXT) memory.$(OBJEXT) strutil.$(OBJEXT) \
freshclam.$(OBJEXT) options.$(OBJEXT) manager.$(OBJEXT) \
notify.$(OBJEXT)
getopt.$(OBJEXT) memory.$(OBJEXT) freshclam.$(OBJEXT) \
options.$(OBJEXT) manager.$(OBJEXT) notify.$(OBJEXT)
freshclam_OBJECTS = $(am_freshclam_OBJECTS)
freshclam_LDADD = $(LDADD)
freshclam_DEPENDENCIES =
@ -168,7 +165,7 @@ am__depfiles_maybe = depfiles
@AMDEP_TRUE@ ./$(DEPDIR)/freshclam.Po ./$(DEPDIR)/getopt.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/manager.Po ./$(DEPDIR)/memory.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/notify.Po ./$(DEPDIR)/options.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/output.Po ./$(DEPDIR)/strutil.Po
@AMDEP_TRUE@ ./$(DEPDIR)/output.Po
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \
@ -221,7 +218,6 @@ output.$(OBJEXT): $(top_srcdir)/shared/output.c
cfgparser.$(OBJEXT): $(top_srcdir)/shared/cfgparser.c
getopt.$(OBJEXT): $(top_srcdir)/shared/getopt.c
memory.$(OBJEXT): $(top_srcdir)/shared/memory.c
strutil.$(OBJEXT): $(top_srcdir)/shared/strutil.c
freshclam$(EXEEXT): $(freshclam_OBJECTS) $(freshclam_DEPENDENCIES)
@rm -f freshclam$(EXEEXT)
$(LINK) $(freshclam_LDFLAGS) $(freshclam_OBJECTS) $(freshclam_LDADD) $(LIBS)
@ -240,7 +236,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/notify.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/options.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/output.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strutil.Po@am__quote@
distclean-depend:
-rm -rf ./$(DEPDIR)
@ -334,24 +329,6 @@ memory.lo: $(top_srcdir)/shared/memory.c
@AMDEP_TRUE@ depfile='$(DEPDIR)/memory.Plo' tmpdepfile='$(DEPDIR)/memory.TPlo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o memory.lo `test -f '$(top_srcdir)/shared/memory.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/memory.c
strutil.o: $(top_srcdir)/shared/strutil.c
@AMDEP_TRUE@ source='$(top_srcdir)/shared/strutil.c' object='strutil.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/strutil.Po' tmpdepfile='$(DEPDIR)/strutil.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strutil.o `test -f '$(top_srcdir)/shared/strutil.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/strutil.c
strutil.obj: $(top_srcdir)/shared/strutil.c
@AMDEP_TRUE@ source='$(top_srcdir)/shared/strutil.c' object='strutil.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/strutil.Po' tmpdepfile='$(DEPDIR)/strutil.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strutil.obj `cygpath -w $(top_srcdir)/shared/strutil.c`
strutil.lo: $(top_srcdir)/shared/strutil.c
@AMDEP_TRUE@ source='$(top_srcdir)/shared/strutil.c' object='strutil.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/strutil.Plo' tmpdepfile='$(DEPDIR)/strutil.TPlo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strutil.lo `test -f '$(top_srcdir)/shared/strutil.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/strutil.c
CCDEPMODE = @CCDEPMODE@
mostlyclean-libtool:

@ -57,7 +57,7 @@ int notify(const char *cfgfile)
} else if((cpt = cfgopt(copt, "LocalSocket"))) {
socktype = "UNIX";
server.sun_family = AF_UNIX;
strlcpy(server.sun_path, cpt->strarg, sizeof(server.sun_path));
strncpy(server.sun_path, cpt->strarg, sizeof(server.sun_path));
if((sockd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) {
mprintf("@Clamd was NOT notified: Can't create socket endpoint for %s\n", cpt->strarg);

@ -107,9 +107,9 @@ int main(int argc, char **argv)
opt->filename=(char*)mcalloc(len + 256, sizeof(char));
for(i=optind; i<argc; i++) {
strlcat(opt->filename, argv[i], len+256);
strncat(opt->filename, argv[i], strlen(argv[i]));
if(i != argc-1)
strlcat(opt->filename, " ", len+256);
strncat(opt->filename, " ", 1);
}
}

@ -16,7 +16,7 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
INCLUDES = -I$(top_srcdir) -I@srcdir@/zziplib -I$(top_srcdir)/shared
INCLUDES = -I$(top_srcdir) -I@srcdir@/zziplib
libclamav_la_LIBADD = @LIBCLAMAV_LIBS@

@ -116,7 +116,7 @@ am__include = @am__include@
am__quote = @am__quote@
install_sh = @install_sh@
INCLUDES = -I$(top_srcdir) -I@srcdir@/zziplib -I$(top_srcdir)/shared
INCLUDES = -I$(top_srcdir) -I@srcdir@/zziplib
libclamav_la_LIBADD = @LIBCLAMAV_LIBS@

@ -34,7 +34,6 @@
#include "others.h"
#include "dsig.h"
#include "str.h"
#include "strutil.h"
#define TAR_BLOCKSIZE 512
@ -75,7 +74,8 @@ int cli_untgz(int fd, const char *destdir)
if (block[0] == '\0') /* We're done */
break;
strlcpy(name, block, 101);
strncpy(name, block, 100);
name[100] = '\0';
strcpy(fullname, destdir);
strcat(fullname, "/");
strcat(fullname, name);
@ -117,7 +117,8 @@ int cli_untgz(int fd, const char *destdir)
return -1;
}
strlcpy(osize, block + 124, 13);
strncpy(osize, block + 124, 12);
osize[12] = '\0';
if((sscanf(osize, "%o", &size)) == 0) {
cli_errmsg("Invalid size in header.\n");

@ -47,7 +47,6 @@ pthread_mutex_t cl_gentemp_mutex = PTHREAD_MUTEX_INITIALIZER;
#include "clamav.h"
#include "others.h"
#include "md5.h"
#include "strutil.h"
#define CL_FLEVEL 1 /* don't touch it */
@ -300,7 +299,7 @@ char *cl_gentemp(const char *dir)
tmp = cl_md5buff(( char* ) salt, 48);
sprintf(name, "%s/", mdir);
strlcat(name, tmp, strlen(mdir) + 1 + 16 + 1);
strncat(name, tmp, 16);
free(tmp);
} while(stat(name, &foo) != -1);

@ -37,7 +37,6 @@
#include "others.h"
#include "str.h"
#include "defaults.h"
#include "strutil.h"
static int cli_parse_add(struct cl_node *root, const char *virname, const char *hexstr, int sigid, int parts, int partno)
{
@ -79,7 +78,7 @@ static int cli_parse_add(struct cl_node *root, const char *virname, const char *
return CL_EMEM;
}
strlcpy(new->virname, virname, virlen);
strncpy(new->virname, virname, virlen);
if((ret = cli_addpatt(root, new))) {
free(new->virname);

@ -30,7 +30,6 @@
#include "clamav.h"
#include "others.h"
#include "defaults.h"
#include "strutil.h"
static int cli_hex2int(int c)
{
@ -180,7 +179,8 @@ char *cli_strtok(const char *line, int fieldno, const char *delim)
return NULL;
}
buffer = malloc(j-i+1);
strlcpy(buffer, line+i, j-i+1);
strncpy(buffer, line+i, j-i);
buffer[j-i] = '\0';
return buffer;
}

@ -69,7 +69,6 @@
#include "unrarlib.h" /* include global configuration */
#include "others.h"
#include "strutil.h"
/* ------------------------------------------------------------------------ */
@ -1181,8 +1180,8 @@ int stricomp(char *Str1,char *Str2)
char S1[512],S2[512];
char *chptr;
strlcpy(S1,Str1,sizeof(S1));
strlcpy(S2,Str2,sizeof(S2));
strncpy(S1,Str1,sizeof(S1));
strncpy(S2,Str2,sizeof(S2));
while((chptr = strchr(S1, '\\')) != NULL) /* ignore backslash */
{

@ -20,7 +20,6 @@
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include "strutil.h"
#ifdef ZZIP_HAVE_SYS_STAT_H
#include <sys/stat.h>
@ -84,9 +83,9 @@ real_readdir(ZZIP_DIR* dir)
if (! dirent) return 0;
dir->dirent.d_name = dirent->d_name;
strlcpy(filename, dir->realname, PATH_MAX);
strlcat(filename, "/", PATH_MAX);
strlcat(filename, dirent->d_name, PATH_MAX);
strcpy(filename, dir->realname);
strcat(filename, "/");
strcat(filename, dirent->d_name);
if (stat(filename, &st) == -1)
return -1;

@ -30,7 +30,6 @@
#include "defaults.h"
#include "str.h"
#include "memory.h"
#include "strutil.h"
static int isnumb(const char *str)
{
@ -177,7 +176,7 @@ struct cfgstruct *parsecfg(const char *cfgfile)
ctype = tolower(arg[strlen(arg) - 1]);
if(ctype == 'm' || ctype == 'k') {
char *cpy = (char *) mcalloc(strlen(arg), sizeof(char));
strlcpy(cpy, arg, strlen(arg));
strncpy(cpy, arg, strlen(arg) - 1);
if(!isnumb(cpy)) {
fprintf(stderr, "ERROR: Parse error at line %d: Option %s requires numerical (raw/K/M) argument.\n", line, name);
return NULL;

@ -42,7 +42,6 @@
#include "output.h"
#include "memory.h"
#include "strutil.h"
#ifdef CL_THREAD_SAFE
#include <pthread.h>
@ -137,7 +136,7 @@ int logg(const char *str, ...)
time(&currtime);
pt = ctime(&currtime);
timestr = mcalloc(strlen(pt), sizeof(char));
strlcpy(timestr, pt, strlen(pt));
strncpy(timestr, pt, strlen(pt) - 1);
fprintf(logg_fd, "%s -> ", timestr);
free(timestr);
}

@ -24,8 +24,6 @@ sigtool_SOURCES = \
$(top_srcdir)/shared/getopt.h \
$(top_srcdir)/shared/memory.c \
$(top_srcdir)/shared/memory.h \
$(top_srcdir)/shared/strutil.c \
$(top_srcdir)/shared/strutil.h \
options.c \
options.h \
sigtool.c

@ -125,8 +125,6 @@ sigtool_SOURCES = \
$(top_srcdir)/shared/getopt.h \
$(top_srcdir)/shared/memory.c \
$(top_srcdir)/shared/memory.h \
$(top_srcdir)/shared/strutil.c \
$(top_srcdir)/shared/strutil.h \
options.c \
options.h \
sigtool.c
@ -145,7 +143,7 @@ bin_PROGRAMS = sigtool$(EXEEXT)
PROGRAMS = $(bin_PROGRAMS)
am_sigtool_OBJECTS = output.$(OBJEXT) getopt.$(OBJEXT) memory.$(OBJEXT) \
strutil.$(OBJEXT) options.$(OBJEXT) sigtool.$(OBJEXT)
options.$(OBJEXT) sigtool.$(OBJEXT)
sigtool_OBJECTS = $(am_sigtool_OBJECTS)
sigtool_DEPENDENCIES = $(top_builddir)/clamscan/others.o
sigtool_LDFLAGS =
@ -156,7 +154,7 @@ depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/getopt.Po ./$(DEPDIR)/memory.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/options.Po ./$(DEPDIR)/output.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/sigtool.Po ./$(DEPDIR)/strutil.Po
@AMDEP_TRUE@ ./$(DEPDIR)/sigtool.Po
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \
@ -208,7 +206,6 @@ clean-binPROGRAMS:
output.$(OBJEXT): $(top_srcdir)/shared/output.c
getopt.$(OBJEXT): $(top_srcdir)/shared/getopt.c
memory.$(OBJEXT): $(top_srcdir)/shared/memory.c
strutil.$(OBJEXT): $(top_srcdir)/shared/strutil.c
sigtool$(EXEEXT): $(sigtool_OBJECTS) $(sigtool_DEPENDENCIES)
@rm -f sigtool$(EXEEXT)
$(LINK) $(sigtool_LDFLAGS) $(sigtool_OBJECTS) $(sigtool_LDADD) $(LIBS)
@ -224,7 +221,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/options.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/output.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigtool.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strutil.Po@am__quote@
distclean-depend:
-rm -rf ./$(DEPDIR)
@ -300,24 +296,6 @@ memory.lo: $(top_srcdir)/shared/memory.c
@AMDEP_TRUE@ depfile='$(DEPDIR)/memory.Plo' tmpdepfile='$(DEPDIR)/memory.TPlo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o memory.lo `test -f '$(top_srcdir)/shared/memory.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/memory.c
strutil.o: $(top_srcdir)/shared/strutil.c
@AMDEP_TRUE@ source='$(top_srcdir)/shared/strutil.c' object='strutil.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/strutil.Po' tmpdepfile='$(DEPDIR)/strutil.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strutil.o `test -f '$(top_srcdir)/shared/strutil.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/strutil.c
strutil.obj: $(top_srcdir)/shared/strutil.c
@AMDEP_TRUE@ source='$(top_srcdir)/shared/strutil.c' object='strutil.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/strutil.Po' tmpdepfile='$(DEPDIR)/strutil.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strutil.obj `cygpath -w $(top_srcdir)/shared/strutil.c`
strutil.lo: $(top_srcdir)/shared/strutil.c
@AMDEP_TRUE@ source='$(top_srcdir)/shared/strutil.c' object='strutil.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/strutil.Plo' tmpdepfile='$(DEPDIR)/strutil.TPlo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strutil.lo `test -f '$(top_srcdir)/shared/strutil.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/strutil.c
CCDEPMODE = @CCDEPMODE@
mostlyclean-libtool:

@ -33,7 +33,6 @@
#include "options.h"
#include "others.h"
#include "strutil.h"
void sigtool(struct optstruct *opt);
@ -114,9 +113,9 @@ int main(int argc, char **argv)
opt->filename=(char*)mcalloc(len + 256, sizeof(char));
for(i=optind; i<argc; i++) {
strlcat(opt->filename, argv[i], len+256);
strncat(opt->filename, argv[i], strlen(argv[i]));
if(i != argc-1)
strlcat(opt->filename, " ", len+256);
strncat(opt->filename, " ", 1);
}
} else

@ -47,7 +47,6 @@
#include "str.h"
#include "memory.h"
#include "output.h"
#include "strutil.h"
#define LINE 1024
@ -482,7 +481,7 @@ int build(struct optstruct *opt)
{
int ret, no = 0, realno = 0, bytes, itmp;
struct stat foo;
char buffer[FILEBUFF], *tarfile = NULL, *gzfile = NULL, header[513],
char buffer[FILEBUFF], *tarfile = NULL, *gzfile = NULL, header[257],
smbuff[30], *pt;
struct cl_node *root = NULL;
FILE *tar, *cvd, *fd;
@ -584,7 +583,7 @@ int build(struct optstruct *opt)
/* magic string */
strlcpy(header, "ClamAV-VDB:", sizeof(header));
strcpy(header, "ClamAV-VDB:");
/* time */
@ -592,7 +591,7 @@ int build(struct optstruct *opt)
brokent = localtime(&timet);
setlocale(LC_TIME, "C");
strftime(smbuff, 30, "%d %b %Y %H-%M %z", brokent);
strlcat(header, smbuff, sizeof(header));
strcat(header, smbuff);
/* version number */
@ -606,21 +605,21 @@ int build(struct optstruct *opt)
scanf("%d", &itmp);
sprintf(smbuff, "%d:", itmp);
}
strlcat(header, smbuff, sizeof(header));
strcat(header, smbuff);
/* number of signatures */
sprintf(smbuff, "%d:", no);
strlcat(header, smbuff, sizeof(header));
strcat(header, smbuff);
/* functionality level (TODO: use cl_funclevel()) */
sprintf(smbuff, "%d:", 1);
strlcat(header, smbuff, sizeof(header));
strcat(header, smbuff);
/* MD5 */
pt = cl_md5file(gzfile);
strlcat(header, pt, sizeof(header));
strcat(header, pt);
free(pt);
strlcat(header, ":", sizeof(header));
strcat(header, ":");
/* builder - question */
fflush(stdin);
@ -637,17 +636,17 @@ int build(struct optstruct *opt)
exit(1);
}
strlcat(header, pt, sizeof(header));
strcat(header, pt);
free(pt);
strlcat(header, ":", sizeof(header));
strcat(header, ":");
/* builder - add */
strlcat(header, smbuff, sizeof(header));
strcat(header, smbuff);
/* fill up with spaces */
while(strlen(header) < 512)
strlcat(header, " ", sizeof(header));
strcat(header, " ");
/* build the final database */

Loading…
Cancel
Save