git-svn-id: file:///var/lib/svn/clamav-devel/trunk/clamav-devel@477 77e5149b-7576-45b1-b177-96237e5ba77b
Tomasz Kojm authored on 2004/04/07 07:43:44... | ... |
@@ -28,8 +28,6 @@ clamav_milter_SOURCES = \ |
28 | 28 |
$(top_srcdir)/shared/getopt.h \ |
29 | 29 |
$(top_srcdir)/shared/memory.c \ |
30 | 30 |
$(top_srcdir)/shared/memory.h \ |
31 |
- $(top_srcdir)/shared/strutil.c \ |
|
32 |
- $(top_srcdir)/shared/strutil.h \ |
|
33 | 31 |
clamav-milter.c |
34 | 32 |
|
35 | 33 |
man_MANS = $(top_srcdir)/docs/man/clamav-milter.8 |
... | ... |
@@ -127,8 +127,6 @@ install_sh = @install_sh@ |
127 | 127 |
@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@ $(top_srcdir)/shared/getopt.h \ |
128 | 128 |
@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@ $(top_srcdir)/shared/memory.c \ |
129 | 129 |
@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@ $(top_srcdir)/shared/memory.h \ |
130 |
-@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@ $(top_srcdir)/shared/strutil.c \ |
|
131 |
-@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@ $(top_srcdir)/shared/strutil.h \ |
|
132 | 130 |
@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@ clamav-milter.c |
133 | 131 |
|
134 | 132 |
|
... | ... |
@@ -154,7 +152,6 @@ PROGRAMS = $(sbin_PROGRAMS) |
154 | 154 |
@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@ cfgparser.$(OBJEXT) \ |
155 | 155 |
@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@ getopt.$(OBJEXT) \ |
156 | 156 |
@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@ memory.$(OBJEXT) \ |
157 |
-@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@ strutil.$(OBJEXT) \ |
|
158 | 157 |
@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@ clamav-milter.$(OBJEXT) |
159 | 158 |
clamav_milter_OBJECTS = $(am_clamav_milter_OBJECTS) |
160 | 159 |
clamav_milter_LDADD = $(LDADD) |
... | ... |
@@ -167,7 +164,7 @@ depcomp = $(SHELL) $(top_srcdir)/depcomp |
167 | 167 |
am__depfiles_maybe = depfiles |
168 | 168 |
@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/cfgparser.Po \ |
169 | 169 |
@AMDEP_TRUE@ ./$(DEPDIR)/clamav-milter.Po ./$(DEPDIR)/getopt.Po \ |
170 |
-@AMDEP_TRUE@ ./$(DEPDIR)/memory.Po ./$(DEPDIR)/strutil.Po |
|
170 |
+@AMDEP_TRUE@ ./$(DEPDIR)/memory.Po |
|
171 | 171 |
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ |
172 | 172 |
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) |
173 | 173 |
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ |
... | ... |
@@ -222,7 +219,6 @@ clean-sbinPROGRAMS: |
222 | 222 |
cfgparser.$(OBJEXT): $(top_srcdir)/shared/cfgparser.c |
223 | 223 |
getopt.$(OBJEXT): $(top_srcdir)/shared/getopt.c |
224 | 224 |
memory.$(OBJEXT): $(top_srcdir)/shared/memory.c |
225 |
-strutil.$(OBJEXT): $(top_srcdir)/shared/strutil.c |
|
226 | 225 |
clamav-milter$(EXEEXT): $(clamav_milter_OBJECTS) $(clamav_milter_DEPENDENCIES) |
227 | 226 |
@rm -f clamav-milter$(EXEEXT) |
228 | 227 |
$(LINK) $(clamav_milter_LDFLAGS) $(clamav_milter_OBJECTS) $(clamav_milter_LDADD) $(LIBS) |
... | ... |
@@ -237,7 +233,6 @@ distclean-compile: |
237 | 237 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clamav-milter.Po@am__quote@ |
238 | 238 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@ |
239 | 239 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memory.Po@am__quote@ |
240 |
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strutil.Po@am__quote@ |
|
241 | 240 |
|
242 | 241 |
distclean-depend: |
243 | 242 |
-rm -rf ./$(DEPDIR) |
... | ... |
@@ -313,24 +308,6 @@ memory.lo: $(top_srcdir)/shared/memory.c |
313 | 313 |
@AMDEP_TRUE@ depfile='$(DEPDIR)/memory.Plo' tmpdepfile='$(DEPDIR)/memory.TPlo' @AMDEPBACKSLASH@ |
314 | 314 |
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
315 | 315 |
$(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 |
316 |
- |
|
317 |
-strutil.o: $(top_srcdir)/shared/strutil.c |
|
318 |
-@AMDEP_TRUE@ source='$(top_srcdir)/shared/strutil.c' object='strutil.o' libtool=no @AMDEPBACKSLASH@ |
|
319 |
-@AMDEP_TRUE@ depfile='$(DEPDIR)/strutil.Po' tmpdepfile='$(DEPDIR)/strutil.TPo' @AMDEPBACKSLASH@ |
|
320 |
-@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
|
321 |
- $(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 |
|
322 |
- |
|
323 |
-strutil.obj: $(top_srcdir)/shared/strutil.c |
|
324 |
-@AMDEP_TRUE@ source='$(top_srcdir)/shared/strutil.c' object='strutil.obj' libtool=no @AMDEPBACKSLASH@ |
|
325 |
-@AMDEP_TRUE@ depfile='$(DEPDIR)/strutil.Po' tmpdepfile='$(DEPDIR)/strutil.TPo' @AMDEPBACKSLASH@ |
|
326 |
-@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
|
327 |
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strutil.obj `cygpath -w $(top_srcdir)/shared/strutil.c` |
|
328 |
- |
|
329 |
-strutil.lo: $(top_srcdir)/shared/strutil.c |
|
330 |
-@AMDEP_TRUE@ source='$(top_srcdir)/shared/strutil.c' object='strutil.lo' libtool=yes @AMDEPBACKSLASH@ |
|
331 |
-@AMDEP_TRUE@ depfile='$(DEPDIR)/strutil.Plo' tmpdepfile='$(DEPDIR)/strutil.TPlo' @AMDEPBACKSLASH@ |
|
332 |
-@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
|
333 |
- $(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 |
|
334 | 316 |
CCDEPMODE = @CCDEPMODE@ |
335 | 317 |
|
336 | 318 |
mostlyclean-libtool: |
... | ... |
@@ -317,6 +317,9 @@ |
317 | 317 |
* |
318 | 318 |
* Change History: |
319 | 319 |
* $Log: clamav-milter.c,v $ |
320 |
+ * Revision 1.70 2004/04/06 22:43:43 kojm |
|
321 |
+ * reverse strlcpy/strlcat patch |
|
322 |
+ * |
|
320 | 323 |
* Revision 1.69 2004/04/06 12:14:52 kojm |
321 | 324 |
* use strlcpy/strlcat |
322 | 325 |
* |
... | ... |
@@ -509,7 +512,7 @@ |
509 | 509 |
* Revision 1.6 2003/09/28 16:37:23 nigelhorne |
510 | 510 |
* Added -f flag use MaxThreads if --max-children not set |
511 | 511 |
*/ |
512 |
-static char const rcsid[] = "$Id: clamav-milter.c,v 1.69 2004/04/06 12:14:52 kojm Exp $"; |
|
512 |
+static char const rcsid[] = "$Id: clamav-milter.c,v 1.70 2004/04/06 22:43:43 kojm Exp $"; |
|
513 | 513 |
|
514 | 514 |
#define CM_VERSION "0.70g" |
515 | 515 |
|
... | ... |
@@ -525,7 +528,6 @@ static char const rcsid[] = "$Id: clamav-milter.c,v 1.69 2004/04/06 12:14:52 koj |
525 | 525 |
#include "str.h" |
526 | 526 |
#include "../libclamav/others.h" |
527 | 527 |
#include "clamav.h" |
528 |
-#include "strutil.h" |
|
529 | 528 |
|
530 | 529 |
#ifndef CL_DEBUG |
531 | 530 |
#define NDEBUG |
... | ... |
@@ -1299,7 +1301,7 @@ pingServer(int serverNumber) |
1299 | 1299 |
|
1300 | 1300 |
memset((char *)&server, 0, sizeof(struct sockaddr_un)); |
1301 | 1301 |
server.sun_family = AF_UNIX; |
1302 |
- strlcpy(server.sun_path, localSocket, sizeof(server.sun_path)); |
|
1302 |
+ strncpy(server.sun_path, localSocket, sizeof(server.sun_path)); |
|
1303 | 1303 |
|
1304 | 1304 |
if((sock = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) { |
1305 | 1305 |
perror("socket"); |
... | ... |
@@ -1912,7 +1914,7 @@ clamfi_eom(SMFICTX *ctx) |
1912 | 1912 |
|
1913 | 1913 |
memset((char *)&server, 0, sizeof(struct sockaddr_un)); |
1914 | 1914 |
server.sun_family = AF_UNIX; |
1915 |
- strlcpy(server.sun_path, localSocket, sizeof(server.sun_path)); |
|
1915 |
+ strncpy(server.sun_path, localSocket, sizeof(server.sun_path)); |
|
1916 | 1916 |
|
1917 | 1917 |
if((privdata->cmdSocket = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) { |
1918 | 1918 |
perror("socket"); |
... | ... |
@@ -2583,7 +2585,7 @@ connect2clamd(struct privdata *privdata) |
2583 | 2583 |
|
2584 | 2584 |
memset((char *)&server, 0, sizeof(struct sockaddr_un)); |
2585 | 2585 |
server.sun_family = AF_UNIX; |
2586 |
- strlcpy(server.sun_path, localSocket, sizeof(server.sun_path)); |
|
2586 |
+ strncpy(server.sun_path, localSocket, sizeof(server.sun_path)); |
|
2587 | 2587 |
|
2588 | 2588 |
if((privdata->cmdSocket = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) { |
2589 | 2589 |
perror("socket"); |
... | ... |
@@ -127,8 +127,6 @@ install_sh = @install_sh@ |
127 | 127 |
@BUILD_CLAMD_TRUE@ $(top_srcdir)/shared/getopt.h \ |
128 | 128 |
@BUILD_CLAMD_TRUE@ $(top_srcdir)/shared/memory.c \ |
129 | 129 |
@BUILD_CLAMD_TRUE@ $(top_srcdir)/shared/memory.h \ |
130 |
-@BUILD_CLAMD_TRUE@ $(top_srcdir)/shared/strutil.c \ |
|
131 |
-@BUILD_CLAMD_TRUE@ $(top_srcdir)/shared/strutil.h \ |
|
132 | 130 |
@BUILD_CLAMD_TRUE@ options.c \ |
133 | 131 |
@BUILD_CLAMD_TRUE@ options.h \ |
134 | 132 |
@BUILD_CLAMD_TRUE@ clamd.c \ |
... | ... |
@@ -173,13 +171,12 @@ PROGRAMS = $(sbin_PROGRAMS) |
173 | 173 |
|
174 | 174 |
@BUILD_CLAMD_TRUE@am_clamd_OBJECTS = output.$(OBJEXT) \ |
175 | 175 |
@BUILD_CLAMD_TRUE@ cfgparser.$(OBJEXT) getopt.$(OBJEXT) \ |
176 |
-@BUILD_CLAMD_TRUE@ memory.$(OBJEXT) strutil.$(OBJEXT) \ |
|
177 |
-@BUILD_CLAMD_TRUE@ options.$(OBJEXT) clamd.$(OBJEXT) \ |
|
178 |
-@BUILD_CLAMD_TRUE@ tcpserver.$(OBJEXT) localserver.$(OBJEXT) \ |
|
179 |
-@BUILD_CLAMD_TRUE@ session.$(OBJEXT) thrmgr.$(OBJEXT) \ |
|
180 |
-@BUILD_CLAMD_TRUE@ server-th.$(OBJEXT) scanner.$(OBJEXT) \ |
|
181 |
-@BUILD_CLAMD_TRUE@ others.$(OBJEXT) clamuko.$(OBJEXT) \ |
|
182 |
-@BUILD_CLAMD_TRUE@ dazukoio_compat12.$(OBJEXT) \ |
|
176 |
+@BUILD_CLAMD_TRUE@ memory.$(OBJEXT) options.$(OBJEXT) \ |
|
177 |
+@BUILD_CLAMD_TRUE@ clamd.$(OBJEXT) tcpserver.$(OBJEXT) \ |
|
178 |
+@BUILD_CLAMD_TRUE@ localserver.$(OBJEXT) session.$(OBJEXT) \ |
|
179 |
+@BUILD_CLAMD_TRUE@ thrmgr.$(OBJEXT) server-th.$(OBJEXT) \ |
|
180 |
+@BUILD_CLAMD_TRUE@ scanner.$(OBJEXT) others.$(OBJEXT) \ |
|
181 |
+@BUILD_CLAMD_TRUE@ clamuko.$(OBJEXT) dazukoio_compat12.$(OBJEXT) \ |
|
183 | 182 |
@BUILD_CLAMD_TRUE@ dazukoio.$(OBJEXT) tests.$(OBJEXT) |
184 | 183 |
clamd_OBJECTS = $(am_clamd_OBJECTS) |
185 | 184 |
clamd_LDADD = $(LDADD) |
... | ... |
@@ -197,9 +194,8 @@ am__depfiles_maybe = depfiles |
197 | 197 |
@AMDEP_TRUE@ ./$(DEPDIR)/memory.Po ./$(DEPDIR)/options.Po \ |
198 | 198 |
@AMDEP_TRUE@ ./$(DEPDIR)/others.Po ./$(DEPDIR)/output.Po \ |
199 | 199 |
@AMDEP_TRUE@ ./$(DEPDIR)/scanner.Po ./$(DEPDIR)/server-th.Po \ |
200 |
-@AMDEP_TRUE@ ./$(DEPDIR)/session.Po ./$(DEPDIR)/strutil.Po \ |
|
201 |
-@AMDEP_TRUE@ ./$(DEPDIR)/tcpserver.Po ./$(DEPDIR)/tests.Po \ |
|
202 |
-@AMDEP_TRUE@ ./$(DEPDIR)/thrmgr.Po |
|
200 |
+@AMDEP_TRUE@ ./$(DEPDIR)/session.Po ./$(DEPDIR)/tcpserver.Po \ |
|
201 |
+@AMDEP_TRUE@ ./$(DEPDIR)/tests.Po ./$(DEPDIR)/thrmgr.Po |
|
203 | 202 |
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ |
204 | 203 |
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) |
205 | 204 |
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ |
... | ... |
@@ -252,7 +248,6 @@ output.$(OBJEXT): $(top_srcdir)/shared/output.c |
252 | 252 |
cfgparser.$(OBJEXT): $(top_srcdir)/shared/cfgparser.c |
253 | 253 |
getopt.$(OBJEXT): $(top_srcdir)/shared/getopt.c |
254 | 254 |
memory.$(OBJEXT): $(top_srcdir)/shared/memory.c |
255 |
-strutil.$(OBJEXT): $(top_srcdir)/shared/strutil.c |
|
256 | 255 |
clamd$(EXEEXT): $(clamd_OBJECTS) $(clamd_DEPENDENCIES) |
257 | 256 |
@rm -f clamd$(EXEEXT) |
258 | 257 |
$(LINK) $(clamd_LDFLAGS) $(clamd_OBJECTS) $(clamd_LDADD) $(LIBS) |
... | ... |
@@ -277,7 +272,6 @@ distclean-compile: |
277 | 277 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scanner.Po@am__quote@ |
278 | 278 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/server-th.Po@am__quote@ |
279 | 279 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/session.Po@am__quote@ |
280 |
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strutil.Po@am__quote@ |
|
281 | 280 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tcpserver.Po@am__quote@ |
282 | 281 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests.Po@am__quote@ |
283 | 282 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/thrmgr.Po@am__quote@ |
... | ... |
@@ -374,24 +368,6 @@ memory.lo: $(top_srcdir)/shared/memory.c |
374 | 374 |
@AMDEP_TRUE@ depfile='$(DEPDIR)/memory.Plo' tmpdepfile='$(DEPDIR)/memory.TPlo' @AMDEPBACKSLASH@ |
375 | 375 |
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
376 | 376 |
$(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 |
377 |
- |
|
378 |
-strutil.o: $(top_srcdir)/shared/strutil.c |
|
379 |
-@AMDEP_TRUE@ source='$(top_srcdir)/shared/strutil.c' object='strutil.o' libtool=no @AMDEPBACKSLASH@ |
|
380 |
-@AMDEP_TRUE@ depfile='$(DEPDIR)/strutil.Po' tmpdepfile='$(DEPDIR)/strutil.TPo' @AMDEPBACKSLASH@ |
|
381 |
-@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
|
382 |
- $(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 |
|
383 |
- |
|
384 |
-strutil.obj: $(top_srcdir)/shared/strutil.c |
|
385 |
-@AMDEP_TRUE@ source='$(top_srcdir)/shared/strutil.c' object='strutil.obj' libtool=no @AMDEPBACKSLASH@ |
|
386 |
-@AMDEP_TRUE@ depfile='$(DEPDIR)/strutil.Po' tmpdepfile='$(DEPDIR)/strutil.TPo' @AMDEPBACKSLASH@ |
|
387 |
-@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
|
388 |
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strutil.obj `cygpath -w $(top_srcdir)/shared/strutil.c` |
|
389 |
- |
|
390 |
-strutil.lo: $(top_srcdir)/shared/strutil.c |
|
391 |
-@AMDEP_TRUE@ source='$(top_srcdir)/shared/strutil.c' object='strutil.lo' libtool=yes @AMDEPBACKSLASH@ |
|
392 |
-@AMDEP_TRUE@ depfile='$(DEPDIR)/strutil.Plo' tmpdepfile='$(DEPDIR)/strutil.TPlo' @AMDEPBACKSLASH@ |
|
393 |
-@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
|
394 |
- $(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 |
|
395 | 377 |
CCDEPMODE = @CCDEPMODE@ |
396 | 378 |
|
397 | 379 |
mostlyclean-libtool: |
... | ... |
@@ -46,7 +46,6 @@ |
46 | 46 |
#include "dazukoio_xp.h" |
47 | 47 |
#include "dazukoio.h" |
48 | 48 |
#include "others.h" |
49 |
-#include "strutil.h" |
|
50 | 49 |
|
51 | 50 |
#if !defined(NO_COMPAT12) |
52 | 51 |
#include "dazukoio_compat12.h" |
... | ... |
@@ -174,12 +173,12 @@ int dazukoRegister_TS(dazuko_id_t **dazuko_id, const char *groupName, const char |
174 | 174 |
|
175 | 175 |
if (strcasecmp(mode, "r") == 0) |
176 | 176 |
{ |
177 |
- strlcpy(regMode, "R", sizeof(regMode)); |
|
177 |
+ strncpy(regMode, "R", sizeof(regMode)); |
|
178 | 178 |
write_mode = 0; |
179 | 179 |
} |
180 | 180 |
else if (strcasecmp(mode, "r+") == 0 || strcasecmp(mode, "rw") == 0) |
181 | 181 |
{ |
182 |
- strlcpy(regMode, "RW", sizeof(regMode)); |
|
182 |
+ strncpy(regMode, "RW", sizeof(regMode)); |
|
183 | 183 |
write_mode = 1; |
184 | 184 |
} |
185 | 185 |
else |
... | ... |
@@ -47,7 +47,6 @@ |
47 | 47 |
#include <unistd.h> |
48 | 48 |
#include <sys/ioctl.h> |
49 | 49 |
#include "dazukoio_compat12.h" |
50 |
-#include "strutil.h" |
|
51 | 50 |
|
52 | 51 |
int dazukoRegister_TS_compat12_wrapper(struct dazuko_id **dazuko_id, const char *groupName) |
53 | 52 |
{ |
... | ... |
@@ -117,7 +116,7 @@ int dazukoRegister_TS_compat12(struct dazuko_id *dazuko, const char *groupName) |
117 | 117 |
memset(opt, 0, sizeof(struct option_compat12)); |
118 | 118 |
|
119 | 119 |
opt->command = REGISTER; |
120 |
- strlcpy(opt->buffer, groupName, sizeof(opt->buffer)); |
|
120 |
+ strncpy(opt->buffer, groupName, sizeof(opt->buffer) - 1); |
|
121 | 121 |
opt->buffer_length = strlen(opt->buffer) + 1; |
122 | 122 |
|
123 | 123 |
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 |
187 | 187 |
memset(opt, 0, sizeof(struct option_compat12)); |
188 | 188 |
|
189 | 189 |
opt->command = command; |
190 |
- strlcpy(opt->buffer, path, sizeof(opt->buffer)); |
|
190 |
+ strncpy(opt->buffer, path, sizeof(opt->buffer) - 1); |
|
191 | 191 |
opt->buffer_length = strlen(opt->buffer) + 1; |
192 | 192 |
|
193 | 193 |
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 |
324 | 324 |
acc_compat12.pid = (*acc)->pid; |
325 | 325 |
if ((*acc)->filename != NULL) |
326 | 326 |
{ |
327 |
- strlcpy(acc_compat12.filename, (*acc)->filename, sizeof(acc_compat12.filename)); |
|
327 |
+ strncpy(acc_compat12.filename, (*acc)->filename, sizeof(acc_compat12.filename) - 1); |
|
328 | 328 |
acc_compat12.filename[sizeof(acc_compat12.filename) - 1] = 0; |
329 | 329 |
} |
330 | 330 |
|
... | ... |
@@ -35,7 +35,6 @@ |
35 | 35 |
#include "others.h" |
36 | 36 |
#include "server.h" |
37 | 37 |
#include "output.h" |
38 |
-#include "strutil.h" |
|
39 | 38 |
|
40 | 39 |
int localserver(const struct optstruct *opt, const struct cfgstruct *copt, struct cl_node *root) |
41 | 40 |
{ |
... | ... |
@@ -47,7 +46,7 @@ int localserver(const struct optstruct *opt, const struct cfgstruct *copt, struc |
47 | 47 |
|
48 | 48 |
memset((char *) &server, 0, sizeof(server)); |
49 | 49 |
server.sun_family = AF_UNIX; |
50 |
- strlcpy(server.sun_path, cfgopt(copt, "LocalSocket")->strarg, sizeof(server.sun_path)); |
|
50 |
+ strncpy(server.sun_path, cfgopt(copt, "LocalSocket")->strarg, sizeof(server.sun_path)); |
|
51 | 51 |
|
52 | 52 |
if((sockfd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) { |
53 | 53 |
estr = strerror(errno); |
... | ... |
@@ -37,7 +37,6 @@ |
37 | 37 |
#include "others.h" |
38 | 38 |
#include "../libclamav/others.h" |
39 | 39 |
#include "memory.h" |
40 |
-#include "strutil.h" |
|
41 | 40 |
|
42 | 41 |
void clamd(struct optstruct *opt); |
43 | 42 |
|
... | ... |
@@ -105,9 +104,9 @@ int main(int argc, char **argv) |
105 | 105 |
opt->filename=(char*)mcalloc(len + 256, sizeof(char)); |
106 | 106 |
|
107 | 107 |
for(i=optind; i<argc; i++) { |
108 |
- strlcat(opt->filename, argv[i], len+256); |
|
108 |
+ strncat(opt->filename, argv[i], strlen(argv[i])); |
|
109 | 109 |
if(i != argc-1) |
110 |
- strlcat(opt->filename, " ", len+256); |
|
110 |
+ strncat(opt->filename, " ", 1); |
|
111 | 111 |
} |
112 | 112 |
|
113 | 113 |
} |
... | ... |
@@ -125,8 +125,6 @@ install_sh = @install_sh@ |
125 | 125 |
@BUILD_CLAMD_TRUE@ $(top_srcdir)/shared/cfgparser.h \ |
126 | 126 |
@BUILD_CLAMD_TRUE@ $(top_srcdir)/shared/memory.c \ |
127 | 127 |
@BUILD_CLAMD_TRUE@ $(top_srcdir)/shared/memory.h \ |
128 |
-@BUILD_CLAMD_TRUE@ $(top_srcdir)/shared/strutil.c \ |
|
129 |
-@BUILD_CLAMD_TRUE@ $(top_srcdir)/shared/strutil.h \ |
|
130 | 128 |
@BUILD_CLAMD_TRUE@ clamdscan.c \ |
131 | 129 |
@BUILD_CLAMD_TRUE@ client.c \ |
132 | 130 |
@BUILD_CLAMD_TRUE@ client.h \ |
... | ... |
@@ -147,8 +145,7 @@ PROGRAMS = $(bin_PROGRAMS) |
147 | 147 |
|
148 | 148 |
@BUILD_CLAMD_TRUE@am_clamdscan_OBJECTS = output.$(OBJEXT) \ |
149 | 149 |
@BUILD_CLAMD_TRUE@ cfgparser.$(OBJEXT) memory.$(OBJEXT) \ |
150 |
-@BUILD_CLAMD_TRUE@ strutil.$(OBJEXT) clamdscan.$(OBJEXT) \ |
|
151 |
-@BUILD_CLAMD_TRUE@ client.$(OBJEXT) |
|
150 |
+@BUILD_CLAMD_TRUE@ clamdscan.$(OBJEXT) client.$(OBJEXT) |
|
152 | 151 |
clamdscan_OBJECTS = $(am_clamdscan_OBJECTS) |
153 | 152 |
@BUILD_CLAMD_TRUE@clamdscan_DEPENDENCIES = \ |
154 | 153 |
@BUILD_CLAMD_TRUE@ $(top_builddir)/clamscan/options.o \ |
... | ... |
@@ -164,8 +161,7 @@ depcomp = $(SHELL) $(top_srcdir)/depcomp |
164 | 164 |
am__depfiles_maybe = depfiles |
165 | 165 |
@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/cfgparser.Po \ |
166 | 166 |
@AMDEP_TRUE@ ./$(DEPDIR)/clamdscan.Po ./$(DEPDIR)/client.Po \ |
167 |
-@AMDEP_TRUE@ ./$(DEPDIR)/memory.Po ./$(DEPDIR)/output.Po \ |
|
168 |
-@AMDEP_TRUE@ ./$(DEPDIR)/strutil.Po |
|
167 |
+@AMDEP_TRUE@ ./$(DEPDIR)/memory.Po ./$(DEPDIR)/output.Po |
|
169 | 168 |
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ |
170 | 169 |
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) |
171 | 170 |
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ |
... | ... |
@@ -217,7 +213,6 @@ clean-binPROGRAMS: |
217 | 217 |
output.$(OBJEXT): $(top_srcdir)/shared/output.c |
218 | 218 |
cfgparser.$(OBJEXT): $(top_srcdir)/shared/cfgparser.c |
219 | 219 |
memory.$(OBJEXT): $(top_srcdir)/shared/memory.c |
220 |
-strutil.$(OBJEXT): $(top_srcdir)/shared/strutil.c |
|
221 | 220 |
clamdscan$(EXEEXT): $(clamdscan_OBJECTS) $(clamdscan_DEPENDENCIES) |
222 | 221 |
@rm -f clamdscan$(EXEEXT) |
223 | 222 |
$(LINK) $(clamdscan_LDFLAGS) $(clamdscan_OBJECTS) $(clamdscan_LDADD) $(LIBS) |
... | ... |
@@ -233,7 +228,6 @@ distclean-compile: |
233 | 233 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/client.Po@am__quote@ |
234 | 234 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memory.Po@am__quote@ |
235 | 235 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/output.Po@am__quote@ |
236 |
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strutil.Po@am__quote@ |
|
237 | 236 |
|
238 | 237 |
distclean-depend: |
239 | 238 |
-rm -rf ./$(DEPDIR) |
... | ... |
@@ -309,24 +303,6 @@ memory.lo: $(top_srcdir)/shared/memory.c |
309 | 309 |
@AMDEP_TRUE@ depfile='$(DEPDIR)/memory.Plo' tmpdepfile='$(DEPDIR)/memory.TPlo' @AMDEPBACKSLASH@ |
310 | 310 |
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
311 | 311 |
$(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 |
312 |
- |
|
313 |
-strutil.o: $(top_srcdir)/shared/strutil.c |
|
314 |
-@AMDEP_TRUE@ source='$(top_srcdir)/shared/strutil.c' object='strutil.o' libtool=no @AMDEPBACKSLASH@ |
|
315 |
-@AMDEP_TRUE@ depfile='$(DEPDIR)/strutil.Po' tmpdepfile='$(DEPDIR)/strutil.TPo' @AMDEPBACKSLASH@ |
|
316 |
-@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
|
317 |
- $(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 |
|
318 |
- |
|
319 |
-strutil.obj: $(top_srcdir)/shared/strutil.c |
|
320 |
-@AMDEP_TRUE@ source='$(top_srcdir)/shared/strutil.c' object='strutil.obj' libtool=no @AMDEPBACKSLASH@ |
|
321 |
-@AMDEP_TRUE@ depfile='$(DEPDIR)/strutil.Po' tmpdepfile='$(DEPDIR)/strutil.TPo' @AMDEPBACKSLASH@ |
|
322 |
-@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
|
323 |
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strutil.obj `cygpath -w $(top_srcdir)/shared/strutil.c` |
|
324 |
- |
|
325 |
-strutil.lo: $(top_srcdir)/shared/strutil.c |
|
326 |
-@AMDEP_TRUE@ source='$(top_srcdir)/shared/strutil.c' object='strutil.lo' libtool=yes @AMDEPBACKSLASH@ |
|
327 |
-@AMDEP_TRUE@ depfile='$(DEPDIR)/strutil.Plo' tmpdepfile='$(DEPDIR)/strutil.TPlo' @AMDEPBACKSLASH@ |
|
328 |
-@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
|
329 |
- $(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 |
|
330 | 312 |
CCDEPMODE = @CCDEPMODE@ |
331 | 313 |
|
332 | 314 |
mostlyclean-libtool: |
... | ... |
@@ -38,7 +38,6 @@ |
38 | 38 |
#include "cfgparser.h" |
39 | 39 |
#include "memory.h" |
40 | 40 |
#include "output.h" |
41 |
-#include "strutil.h" |
|
42 | 41 |
|
43 | 42 |
#ifdef PF_INET |
44 | 43 |
# define SOCKET_INET PF_INET |
... | ... |
@@ -79,7 +78,7 @@ int client(const struct optstruct *opt) |
79 | 79 |
} else if((cpt = cfgopt(copt, "LocalSocket"))) { |
80 | 80 |
|
81 | 81 |
server.sun_family = AF_UNIX; |
82 |
- strlcpy(server.sun_path, cpt->strarg, sizeof(server.sun_path)); |
|
82 |
+ strncpy(server.sun_path, cpt->strarg, sizeof(server.sun_path)); |
|
83 | 83 |
|
84 | 84 |
if((sockd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) { |
85 | 85 |
perror("socket()"); |
... | ... |
@@ -126,8 +126,6 @@ clamscan_SOURCES = \ |
126 | 126 |
$(top_srcdir)/shared/getopt.h \ |
127 | 127 |
$(top_srcdir)/shared/memory.c \ |
128 | 128 |
$(top_srcdir)/shared/memory.h \ |
129 |
- $(top_srcdir)/shared/strutil.c \ |
|
130 |
- $(top_srcdir)/shared/strutil.h \ |
|
131 | 129 |
clamscan.c \ |
132 | 130 |
options.c \ |
133 | 131 |
options.h \ |
... | ... |
@@ -152,8 +150,8 @@ bin_PROGRAMS = clamscan$(EXEEXT) |
152 | 152 |
PROGRAMS = $(bin_PROGRAMS) |
153 | 153 |
|
154 | 154 |
am_clamscan_OBJECTS = output.$(OBJEXT) getopt.$(OBJEXT) memory.$(OBJEXT) \ |
155 |
- strutil.$(OBJEXT) clamscan.$(OBJEXT) options.$(OBJEXT) \ |
|
156 |
- others.$(OBJEXT) manager.$(OBJEXT) treewalk.$(OBJEXT) |
|
155 |
+ clamscan.$(OBJEXT) options.$(OBJEXT) others.$(OBJEXT) \ |
|
156 |
+ manager.$(OBJEXT) treewalk.$(OBJEXT) |
|
157 | 157 |
clamscan_OBJECTS = $(am_clamscan_OBJECTS) |
158 | 158 |
clamscan_LDADD = $(LDADD) |
159 | 159 |
clamscan_DEPENDENCIES = |
... | ... |
@@ -166,8 +164,7 @@ am__depfiles_maybe = depfiles |
166 | 166 |
@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/clamscan.Po ./$(DEPDIR)/getopt.Po \ |
167 | 167 |
@AMDEP_TRUE@ ./$(DEPDIR)/manager.Po ./$(DEPDIR)/memory.Po \ |
168 | 168 |
@AMDEP_TRUE@ ./$(DEPDIR)/options.Po ./$(DEPDIR)/others.Po \ |
169 |
-@AMDEP_TRUE@ ./$(DEPDIR)/output.Po ./$(DEPDIR)/strutil.Po \ |
|
170 |
-@AMDEP_TRUE@ ./$(DEPDIR)/treewalk.Po |
|
169 |
+@AMDEP_TRUE@ ./$(DEPDIR)/output.Po ./$(DEPDIR)/treewalk.Po |
|
171 | 170 |
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ |
172 | 171 |
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) |
173 | 172 |
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ |
... | ... |
@@ -219,7 +216,6 @@ clean-binPROGRAMS: |
219 | 219 |
output.$(OBJEXT): $(top_srcdir)/shared/output.c |
220 | 220 |
getopt.$(OBJEXT): $(top_srcdir)/shared/getopt.c |
221 | 221 |
memory.$(OBJEXT): $(top_srcdir)/shared/memory.c |
222 |
-strutil.$(OBJEXT): $(top_srcdir)/shared/strutil.c |
|
223 | 222 |
clamscan$(EXEEXT): $(clamscan_OBJECTS) $(clamscan_DEPENDENCIES) |
224 | 223 |
@rm -f clamscan$(EXEEXT) |
225 | 224 |
$(LINK) $(clamscan_LDFLAGS) $(clamscan_OBJECTS) $(clamscan_LDADD) $(LIBS) |
... | ... |
@@ -237,7 +233,6 @@ distclean-compile: |
237 | 237 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/options.Po@am__quote@ |
238 | 238 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/others.Po@am__quote@ |
239 | 239 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/output.Po@am__quote@ |
240 |
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strutil.Po@am__quote@ |
|
241 | 240 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/treewalk.Po@am__quote@ |
242 | 241 |
|
243 | 242 |
distclean-depend: |
... | ... |
@@ -314,24 +309,6 @@ memory.lo: $(top_srcdir)/shared/memory.c |
314 | 314 |
@AMDEP_TRUE@ depfile='$(DEPDIR)/memory.Plo' tmpdepfile='$(DEPDIR)/memory.TPlo' @AMDEPBACKSLASH@ |
315 | 315 |
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
316 | 316 |
$(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 |
317 |
- |
|
318 |
-strutil.o: $(top_srcdir)/shared/strutil.c |
|
319 |
-@AMDEP_TRUE@ source='$(top_srcdir)/shared/strutil.c' object='strutil.o' libtool=no @AMDEPBACKSLASH@ |
|
320 |
-@AMDEP_TRUE@ depfile='$(DEPDIR)/strutil.Po' tmpdepfile='$(DEPDIR)/strutil.TPo' @AMDEPBACKSLASH@ |
|
321 |
-@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
|
322 |
- $(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 |
|
323 |
- |
|
324 |
-strutil.obj: $(top_srcdir)/shared/strutil.c |
|
325 |
-@AMDEP_TRUE@ source='$(top_srcdir)/shared/strutil.c' object='strutil.obj' libtool=no @AMDEPBACKSLASH@ |
|
326 |
-@AMDEP_TRUE@ depfile='$(DEPDIR)/strutil.Po' tmpdepfile='$(DEPDIR)/strutil.TPo' @AMDEPBACKSLASH@ |
|
327 |
-@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
|
328 |
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strutil.obj `cygpath -w $(top_srcdir)/shared/strutil.c` |
|
329 |
- |
|
330 |
-strutil.lo: $(top_srcdir)/shared/strutil.c |
|
331 |
-@AMDEP_TRUE@ source='$(top_srcdir)/shared/strutil.c' object='strutil.lo' libtool=yes @AMDEPBACKSLASH@ |
|
332 |
-@AMDEP_TRUE@ depfile='$(DEPDIR)/strutil.Plo' tmpdepfile='$(DEPDIR)/strutil.TPlo' @AMDEPBACKSLASH@ |
|
333 |
-@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
|
334 |
- $(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 |
|
335 | 317 |
CCDEPMODE = @CCDEPMODE@ |
336 | 318 |
|
337 | 319 |
mostlyclean-libtool: |
... | ... |
@@ -49,7 +49,6 @@ |
49 | 49 |
#include "strrcpy.h" |
50 | 50 |
#include "memory.h" |
51 | 51 |
#include "output.h" |
52 |
-#include "strutil.h" |
|
53 | 52 |
|
54 | 53 |
#ifdef C_LINUX |
55 | 54 |
dev_t procdev; |
... | ... |
@@ -134,7 +133,7 @@ int scanmanager(const struct optstruct *opt) |
134 | 134 |
ptr = getargl(opt, "max-space"); |
135 | 135 |
if(tolower(ptr[strlen(ptr) - 1]) == 'm') { |
136 | 136 |
cpy = mcalloc(strlen(ptr), sizeof(char)); |
137 |
- strlcpy(cpy, ptr, strlen(ptr)); |
|
137 |
+ strncpy(cpy, ptr, strlen(ptr) - 1); |
|
138 | 138 |
limits->maxfilesize = atoi(cpy) * 1024 * 1024; |
139 | 139 |
free(cpy); |
140 | 140 |
} else |
... | ... |
@@ -843,7 +842,7 @@ int clamav_unpack(const char *prog, char **args, const char *tmpdir, const struc |
843 | 843 |
ptr = getargl(opt, "max-space"); |
844 | 844 |
if(tolower(ptr[strlen(ptr) - 1]) == 'm') { /* megabytes */ |
845 | 845 |
cpy = mcalloc(strlen(ptr), sizeof(char)); |
846 |
- strlcpy(cpy, ptr, strlen(ptr)); |
|
846 |
+ strncpy(cpy, ptr, strlen(ptr) - 1); |
|
847 | 847 |
maxspace = atoi(cpy) * 1024; |
848 | 848 |
free(cpy); |
849 | 849 |
} else /* default - kilobytes */ |
... | ... |
@@ -35,7 +35,6 @@ |
35 | 35 |
#include "shared.h" |
36 | 36 |
#include "memory.h" |
37 | 37 |
#include "output.h" |
38 |
-#include "strutil.h" |
|
39 | 38 |
|
40 | 39 |
extern int clamscan(struct optstruct *opt); |
41 | 40 |
|
... | ... |
@@ -139,9 +138,9 @@ int main(int argc, char **argv) |
139 | 139 |
opt->filename=(char*)mcalloc(len + 256, sizeof(char)); |
140 | 140 |
|
141 | 141 |
for(i=optind; i<argc; i++) { |
142 |
- strlcat(opt->filename, argv[i], len+256); |
|
142 |
+ strncat(opt->filename, argv[i], strlen(argv[i])); |
|
143 | 143 |
if(i != argc-1) |
144 |
- strlcat(opt->filename, "\t", len+256); |
|
144 |
+ strncat(opt->filename, "\t", 1); |
|
145 | 145 |
} |
146 | 146 |
|
147 | 147 |
} |
... | ... |
@@ -128,8 +128,6 @@ freshclam_SOURCES = \ |
128 | 128 |
$(top_srcdir)/shared/getopt.h \ |
129 | 129 |
$(top_srcdir)/shared/memory.c \ |
130 | 130 |
$(top_srcdir)/shared/memory.h \ |
131 |
- $(top_srcdir)/shared/strutil.c \ |
|
132 |
- $(top_srcdir)/shared/strutil.h \ |
|
133 | 131 |
freshclam.c \ |
134 | 132 |
freshclam.h \ |
135 | 133 |
options.c \ |
... | ... |
@@ -152,9 +150,8 @@ bin_PROGRAMS = freshclam$(EXEEXT) |
152 | 152 |
PROGRAMS = $(bin_PROGRAMS) |
153 | 153 |
|
154 | 154 |
am_freshclam_OBJECTS = output.$(OBJEXT) cfgparser.$(OBJEXT) \ |
155 |
- getopt.$(OBJEXT) memory.$(OBJEXT) strutil.$(OBJEXT) \ |
|
156 |
- freshclam.$(OBJEXT) options.$(OBJEXT) manager.$(OBJEXT) \ |
|
157 |
- notify.$(OBJEXT) |
|
155 |
+ getopt.$(OBJEXT) memory.$(OBJEXT) freshclam.$(OBJEXT) \ |
|
156 |
+ options.$(OBJEXT) manager.$(OBJEXT) notify.$(OBJEXT) |
|
158 | 157 |
freshclam_OBJECTS = $(am_freshclam_OBJECTS) |
159 | 158 |
freshclam_LDADD = $(LDADD) |
160 | 159 |
freshclam_DEPENDENCIES = |
... | ... |
@@ -168,7 +165,7 @@ am__depfiles_maybe = depfiles |
168 | 168 |
@AMDEP_TRUE@ ./$(DEPDIR)/freshclam.Po ./$(DEPDIR)/getopt.Po \ |
169 | 169 |
@AMDEP_TRUE@ ./$(DEPDIR)/manager.Po ./$(DEPDIR)/memory.Po \ |
170 | 170 |
@AMDEP_TRUE@ ./$(DEPDIR)/notify.Po ./$(DEPDIR)/options.Po \ |
171 |
-@AMDEP_TRUE@ ./$(DEPDIR)/output.Po ./$(DEPDIR)/strutil.Po |
|
171 |
+@AMDEP_TRUE@ ./$(DEPDIR)/output.Po |
|
172 | 172 |
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ |
173 | 173 |
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) |
174 | 174 |
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ |
... | ... |
@@ -221,7 +218,6 @@ output.$(OBJEXT): $(top_srcdir)/shared/output.c |
221 | 221 |
cfgparser.$(OBJEXT): $(top_srcdir)/shared/cfgparser.c |
222 | 222 |
getopt.$(OBJEXT): $(top_srcdir)/shared/getopt.c |
223 | 223 |
memory.$(OBJEXT): $(top_srcdir)/shared/memory.c |
224 |
-strutil.$(OBJEXT): $(top_srcdir)/shared/strutil.c |
|
225 | 224 |
freshclam$(EXEEXT): $(freshclam_OBJECTS) $(freshclam_DEPENDENCIES) |
226 | 225 |
@rm -f freshclam$(EXEEXT) |
227 | 226 |
$(LINK) $(freshclam_LDFLAGS) $(freshclam_OBJECTS) $(freshclam_LDADD) $(LIBS) |
... | ... |
@@ -240,7 +236,6 @@ distclean-compile: |
240 | 240 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/notify.Po@am__quote@ |
241 | 241 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/options.Po@am__quote@ |
242 | 242 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/output.Po@am__quote@ |
243 |
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strutil.Po@am__quote@ |
|
244 | 243 |
|
245 | 244 |
distclean-depend: |
246 | 245 |
-rm -rf ./$(DEPDIR) |
... | ... |
@@ -334,24 +329,6 @@ memory.lo: $(top_srcdir)/shared/memory.c |
334 | 334 |
@AMDEP_TRUE@ depfile='$(DEPDIR)/memory.Plo' tmpdepfile='$(DEPDIR)/memory.TPlo' @AMDEPBACKSLASH@ |
335 | 335 |
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
336 | 336 |
$(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 |
337 |
- |
|
338 |
-strutil.o: $(top_srcdir)/shared/strutil.c |
|
339 |
-@AMDEP_TRUE@ source='$(top_srcdir)/shared/strutil.c' object='strutil.o' libtool=no @AMDEPBACKSLASH@ |
|
340 |
-@AMDEP_TRUE@ depfile='$(DEPDIR)/strutil.Po' tmpdepfile='$(DEPDIR)/strutil.TPo' @AMDEPBACKSLASH@ |
|
341 |
-@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
|
342 |
- $(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 |
|
343 |
- |
|
344 |
-strutil.obj: $(top_srcdir)/shared/strutil.c |
|
345 |
-@AMDEP_TRUE@ source='$(top_srcdir)/shared/strutil.c' object='strutil.obj' libtool=no @AMDEPBACKSLASH@ |
|
346 |
-@AMDEP_TRUE@ depfile='$(DEPDIR)/strutil.Po' tmpdepfile='$(DEPDIR)/strutil.TPo' @AMDEPBACKSLASH@ |
|
347 |
-@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
|
348 |
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strutil.obj `cygpath -w $(top_srcdir)/shared/strutil.c` |
|
349 |
- |
|
350 |
-strutil.lo: $(top_srcdir)/shared/strutil.c |
|
351 |
-@AMDEP_TRUE@ source='$(top_srcdir)/shared/strutil.c' object='strutil.lo' libtool=yes @AMDEPBACKSLASH@ |
|
352 |
-@AMDEP_TRUE@ depfile='$(DEPDIR)/strutil.Plo' tmpdepfile='$(DEPDIR)/strutil.TPlo' @AMDEPBACKSLASH@ |
|
353 |
-@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
|
354 |
- $(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 |
|
355 | 337 |
CCDEPMODE = @CCDEPMODE@ |
356 | 338 |
|
357 | 339 |
mostlyclean-libtool: |
... | ... |
@@ -57,7 +57,7 @@ int notify(const char *cfgfile) |
57 | 57 |
} else if((cpt = cfgopt(copt, "LocalSocket"))) { |
58 | 58 |
socktype = "UNIX"; |
59 | 59 |
server.sun_family = AF_UNIX; |
60 |
- strlcpy(server.sun_path, cpt->strarg, sizeof(server.sun_path)); |
|
60 |
+ strncpy(server.sun_path, cpt->strarg, sizeof(server.sun_path)); |
|
61 | 61 |
|
62 | 62 |
if((sockd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) { |
63 | 63 |
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) |
107 | 107 |
opt->filename=(char*)mcalloc(len + 256, sizeof(char)); |
108 | 108 |
|
109 | 109 |
for(i=optind; i<argc; i++) { |
110 |
- strlcat(opt->filename, argv[i], len+256); |
|
110 |
+ strncat(opt->filename, argv[i], strlen(argv[i])); |
|
111 | 111 |
if(i != argc-1) |
112 |
- strlcat(opt->filename, " ", len+256); |
|
112 |
+ strncat(opt->filename, " ", 1); |
|
113 | 113 |
} |
114 | 114 |
|
115 | 115 |
} |
... | ... |
@@ -116,7 +116,7 @@ am__include = @am__include@ |
116 | 116 |
am__quote = @am__quote@ |
117 | 117 |
install_sh = @install_sh@ |
118 | 118 |
|
119 |
-INCLUDES = -I$(top_srcdir) -I@srcdir@/zziplib -I$(top_srcdir)/shared |
|
119 |
+INCLUDES = -I$(top_srcdir) -I@srcdir@/zziplib |
|
120 | 120 |
|
121 | 121 |
libclamav_la_LIBADD = @LIBCLAMAV_LIBS@ |
122 | 122 |
|
... | ... |
@@ -34,7 +34,6 @@ |
34 | 34 |
#include "others.h" |
35 | 35 |
#include "dsig.h" |
36 | 36 |
#include "str.h" |
37 |
-#include "strutil.h" |
|
38 | 37 |
|
39 | 38 |
#define TAR_BLOCKSIZE 512 |
40 | 39 |
|
... | ... |
@@ -75,7 +74,8 @@ int cli_untgz(int fd, const char *destdir) |
75 | 75 |
if (block[0] == '\0') /* We're done */ |
76 | 76 |
break; |
77 | 77 |
|
78 |
- strlcpy(name, block, 101); |
|
78 |
+ strncpy(name, block, 100); |
|
79 |
+ name[100] = '\0'; |
|
79 | 80 |
strcpy(fullname, destdir); |
80 | 81 |
strcat(fullname, "/"); |
81 | 82 |
strcat(fullname, name); |
... | ... |
@@ -117,7 +117,8 @@ int cli_untgz(int fd, const char *destdir) |
117 | 117 |
return -1; |
118 | 118 |
} |
119 | 119 |
|
120 |
- strlcpy(osize, block + 124, 13); |
|
120 |
+ strncpy(osize, block + 124, 12); |
|
121 |
+ osize[12] = '\0'; |
|
121 | 122 |
|
122 | 123 |
if((sscanf(osize, "%o", &size)) == 0) { |
123 | 124 |
cli_errmsg("Invalid size in header.\n"); |
... | ... |
@@ -47,7 +47,6 @@ pthread_mutex_t cl_gentemp_mutex = PTHREAD_MUTEX_INITIALIZER; |
47 | 47 |
#include "clamav.h" |
48 | 48 |
#include "others.h" |
49 | 49 |
#include "md5.h" |
50 |
-#include "strutil.h" |
|
51 | 50 |
|
52 | 51 |
#define CL_FLEVEL 1 /* don't touch it */ |
53 | 52 |
|
... | ... |
@@ -300,7 +299,7 @@ char *cl_gentemp(const char *dir) |
300 | 300 |
|
301 | 301 |
tmp = cl_md5buff(( char* ) salt, 48); |
302 | 302 |
sprintf(name, "%s/", mdir); |
303 |
- strlcat(name, tmp, strlen(mdir) + 1 + 16 + 1); |
|
303 |
+ strncat(name, tmp, 16); |
|
304 | 304 |
free(tmp); |
305 | 305 |
} while(stat(name, &foo) != -1); |
306 | 306 |
|
... | ... |
@@ -37,7 +37,6 @@ |
37 | 37 |
#include "others.h" |
38 | 38 |
#include "str.h" |
39 | 39 |
#include "defaults.h" |
40 |
-#include "strutil.h" |
|
41 | 40 |
|
42 | 41 |
static int cli_parse_add(struct cl_node *root, const char *virname, const char *hexstr, int sigid, int parts, int partno) |
43 | 42 |
{ |
... | ... |
@@ -79,7 +78,7 @@ static int cli_parse_add(struct cl_node *root, const char *virname, const char * |
79 | 79 |
return CL_EMEM; |
80 | 80 |
} |
81 | 81 |
|
82 |
- strlcpy(new->virname, virname, virlen); |
|
82 |
+ strncpy(new->virname, virname, virlen); |
|
83 | 83 |
|
84 | 84 |
if((ret = cli_addpatt(root, new))) { |
85 | 85 |
free(new->virname); |
... | ... |
@@ -30,7 +30,6 @@ |
30 | 30 |
#include "clamav.h" |
31 | 31 |
#include "others.h" |
32 | 32 |
#include "defaults.h" |
33 |
-#include "strutil.h" |
|
34 | 33 |
|
35 | 34 |
static int cli_hex2int(int c) |
36 | 35 |
{ |
... | ... |
@@ -180,7 +179,8 @@ char *cli_strtok(const char *line, int fieldno, const char *delim) |
180 | 180 |
return NULL; |
181 | 181 |
} |
182 | 182 |
buffer = malloc(j-i+1); |
183 |
- strlcpy(buffer, line+i, j-i+1); |
|
183 |
+ strncpy(buffer, line+i, j-i); |
|
184 |
+ buffer[j-i] = '\0'; |
|
184 | 185 |
|
185 | 186 |
return buffer; |
186 | 187 |
} |
... | ... |
@@ -69,7 +69,6 @@ |
69 | 69 |
|
70 | 70 |
#include "unrarlib.h" /* include global configuration */ |
71 | 71 |
#include "others.h" |
72 |
-#include "strutil.h" |
|
73 | 72 |
/* ------------------------------------------------------------------------ */ |
74 | 73 |
|
75 | 74 |
|
... | ... |
@@ -1181,8 +1180,8 @@ int stricomp(char *Str1,char *Str2) |
1181 | 1181 |
char S1[512],S2[512]; |
1182 | 1182 |
char *chptr; |
1183 | 1183 |
|
1184 |
- strlcpy(S1,Str1,sizeof(S1)); |
|
1185 |
- strlcpy(S2,Str2,sizeof(S2)); |
|
1184 |
+ strncpy(S1,Str1,sizeof(S1)); |
|
1185 |
+ strncpy(S2,Str2,sizeof(S2)); |
|
1186 | 1186 |
|
1187 | 1187 |
while((chptr = strchr(S1, '\\')) != NULL) /* ignore backslash */ |
1188 | 1188 |
{ |
... | ... |
@@ -20,7 +20,6 @@ |
20 | 20 |
#include <stdlib.h> |
21 | 21 |
#include <string.h> |
22 | 22 |
#include <errno.h> |
23 |
-#include "strutil.h" |
|
24 | 23 |
|
25 | 24 |
#ifdef ZZIP_HAVE_SYS_STAT_H |
26 | 25 |
#include <sys/stat.h> |
... | ... |
@@ -84,9 +83,9 @@ real_readdir(ZZIP_DIR* dir) |
84 | 84 |
if (! dirent) return 0; |
85 | 85 |
|
86 | 86 |
dir->dirent.d_name = dirent->d_name; |
87 |
- strlcpy(filename, dir->realname, PATH_MAX); |
|
88 |
- strlcat(filename, "/", PATH_MAX); |
|
89 |
- strlcat(filename, dirent->d_name, PATH_MAX); |
|
87 |
+ strcpy(filename, dir->realname); |
|
88 |
+ strcat(filename, "/"); |
|
89 |
+ strcat(filename, dirent->d_name); |
|
90 | 90 |
|
91 | 91 |
if (stat(filename, &st) == -1) |
92 | 92 |
return -1; |
... | ... |
@@ -30,7 +30,6 @@ |
30 | 30 |
#include "defaults.h" |
31 | 31 |
#include "str.h" |
32 | 32 |
#include "memory.h" |
33 |
-#include "strutil.h" |
|
34 | 33 |
|
35 | 34 |
static int isnumb(const char *str) |
36 | 35 |
{ |
... | ... |
@@ -177,7 +176,7 @@ struct cfgstruct *parsecfg(const char *cfgfile) |
177 | 177 |
ctype = tolower(arg[strlen(arg) - 1]); |
178 | 178 |
if(ctype == 'm' || ctype == 'k') { |
179 | 179 |
char *cpy = (char *) mcalloc(strlen(arg), sizeof(char)); |
180 |
- strlcpy(cpy, arg, strlen(arg)); |
|
180 |
+ strncpy(cpy, arg, strlen(arg) - 1); |
|
181 | 181 |
if(!isnumb(cpy)) { |
182 | 182 |
fprintf(stderr, "ERROR: Parse error at line %d: Option %s requires numerical (raw/K/M) argument.\n", line, name); |
183 | 183 |
return NULL; |
... | ... |
@@ -42,7 +42,6 @@ |
42 | 42 |
|
43 | 43 |
#include "output.h" |
44 | 44 |
#include "memory.h" |
45 |
-#include "strutil.h" |
|
46 | 45 |
|
47 | 46 |
#ifdef CL_THREAD_SAFE |
48 | 47 |
#include <pthread.h> |
... | ... |
@@ -137,7 +136,7 @@ int logg(const char *str, ...) |
137 | 137 |
time(&currtime); |
138 | 138 |
pt = ctime(&currtime); |
139 | 139 |
timestr = mcalloc(strlen(pt), sizeof(char)); |
140 |
- strlcpy(timestr, pt, strlen(pt)); |
|
140 |
+ strncpy(timestr, pt, strlen(pt) - 1); |
|
141 | 141 |
fprintf(logg_fd, "%s -> ", timestr); |
142 | 142 |
free(timestr); |
143 | 143 |
} |
... | ... |
@@ -125,8 +125,6 @@ sigtool_SOURCES = \ |
125 | 125 |
$(top_srcdir)/shared/getopt.h \ |
126 | 126 |
$(top_srcdir)/shared/memory.c \ |
127 | 127 |
$(top_srcdir)/shared/memory.h \ |
128 |
- $(top_srcdir)/shared/strutil.c \ |
|
129 |
- $(top_srcdir)/shared/strutil.h \ |
|
130 | 128 |
options.c \ |
131 | 129 |
options.h \ |
132 | 130 |
sigtool.c |
... | ... |
@@ -145,7 +143,7 @@ bin_PROGRAMS = sigtool$(EXEEXT) |
145 | 145 |
PROGRAMS = $(bin_PROGRAMS) |
146 | 146 |
|
147 | 147 |
am_sigtool_OBJECTS = output.$(OBJEXT) getopt.$(OBJEXT) memory.$(OBJEXT) \ |
148 |
- strutil.$(OBJEXT) options.$(OBJEXT) sigtool.$(OBJEXT) |
|
148 |
+ options.$(OBJEXT) sigtool.$(OBJEXT) |
|
149 | 149 |
sigtool_OBJECTS = $(am_sigtool_OBJECTS) |
150 | 150 |
sigtool_DEPENDENCIES = $(top_builddir)/clamscan/others.o |
151 | 151 |
sigtool_LDFLAGS = |
... | ... |
@@ -156,7 +154,7 @@ depcomp = $(SHELL) $(top_srcdir)/depcomp |
156 | 156 |
am__depfiles_maybe = depfiles |
157 | 157 |
@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/getopt.Po ./$(DEPDIR)/memory.Po \ |
158 | 158 |
@AMDEP_TRUE@ ./$(DEPDIR)/options.Po ./$(DEPDIR)/output.Po \ |
159 |
-@AMDEP_TRUE@ ./$(DEPDIR)/sigtool.Po ./$(DEPDIR)/strutil.Po |
|
159 |
+@AMDEP_TRUE@ ./$(DEPDIR)/sigtool.Po |
|
160 | 160 |
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ |
161 | 161 |
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) |
162 | 162 |
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ |
... | ... |
@@ -208,7 +206,6 @@ clean-binPROGRAMS: |
208 | 208 |
output.$(OBJEXT): $(top_srcdir)/shared/output.c |
209 | 209 |
getopt.$(OBJEXT): $(top_srcdir)/shared/getopt.c |
210 | 210 |
memory.$(OBJEXT): $(top_srcdir)/shared/memory.c |
211 |
-strutil.$(OBJEXT): $(top_srcdir)/shared/strutil.c |
|
212 | 211 |
sigtool$(EXEEXT): $(sigtool_OBJECTS) $(sigtool_DEPENDENCIES) |
213 | 212 |
@rm -f sigtool$(EXEEXT) |
214 | 213 |
$(LINK) $(sigtool_LDFLAGS) $(sigtool_OBJECTS) $(sigtool_LDADD) $(LIBS) |
... | ... |
@@ -224,7 +221,6 @@ distclean-compile: |
224 | 224 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/options.Po@am__quote@ |
225 | 225 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/output.Po@am__quote@ |
226 | 226 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigtool.Po@am__quote@ |
227 |
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strutil.Po@am__quote@ |
|
228 | 227 |
|
229 | 228 |
distclean-depend: |
230 | 229 |
-rm -rf ./$(DEPDIR) |
... | ... |
@@ -300,24 +296,6 @@ memory.lo: $(top_srcdir)/shared/memory.c |
300 | 300 |
@AMDEP_TRUE@ depfile='$(DEPDIR)/memory.Plo' tmpdepfile='$(DEPDIR)/memory.TPlo' @AMDEPBACKSLASH@ |
301 | 301 |
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
302 | 302 |
$(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 |
303 |
- |
|
304 |
-strutil.o: $(top_srcdir)/shared/strutil.c |
|
305 |
-@AMDEP_TRUE@ source='$(top_srcdir)/shared/strutil.c' object='strutil.o' libtool=no @AMDEPBACKSLASH@ |
|
306 |
-@AMDEP_TRUE@ depfile='$(DEPDIR)/strutil.Po' tmpdepfile='$(DEPDIR)/strutil.TPo' @AMDEPBACKSLASH@ |
|
307 |
-@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
|
308 |
- $(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 |
|
309 |
- |
|
310 |
-strutil.obj: $(top_srcdir)/shared/strutil.c |
|
311 |
-@AMDEP_TRUE@ source='$(top_srcdir)/shared/strutil.c' object='strutil.obj' libtool=no @AMDEPBACKSLASH@ |
|
312 |
-@AMDEP_TRUE@ depfile='$(DEPDIR)/strutil.Po' tmpdepfile='$(DEPDIR)/strutil.TPo' @AMDEPBACKSLASH@ |
|
313 |
-@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
|
314 |
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strutil.obj `cygpath -w $(top_srcdir)/shared/strutil.c` |
|
315 |
- |
|
316 |
-strutil.lo: $(top_srcdir)/shared/strutil.c |
|
317 |
-@AMDEP_TRUE@ source='$(top_srcdir)/shared/strutil.c' object='strutil.lo' libtool=yes @AMDEPBACKSLASH@ |
|
318 |
-@AMDEP_TRUE@ depfile='$(DEPDIR)/strutil.Plo' tmpdepfile='$(DEPDIR)/strutil.TPlo' @AMDEPBACKSLASH@ |
|
319 |
-@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
|
320 |
- $(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 |
|
321 | 303 |
CCDEPMODE = @CCDEPMODE@ |
322 | 304 |
|
323 | 305 |
mostlyclean-libtool: |
... | ... |
@@ -33,7 +33,6 @@ |
33 | 33 |
|
34 | 34 |
#include "options.h" |
35 | 35 |
#include "others.h" |
36 |
-#include "strutil.h" |
|
37 | 36 |
|
38 | 37 |
void sigtool(struct optstruct *opt); |
39 | 38 |
|
... | ... |
@@ -114,9 +113,9 @@ int main(int argc, char **argv) |
114 | 114 |
opt->filename=(char*)mcalloc(len + 256, sizeof(char)); |
115 | 115 |
|
116 | 116 |
for(i=optind; i<argc; i++) { |
117 |
- strlcat(opt->filename, argv[i], len+256); |
|
117 |
+ strncat(opt->filename, argv[i], strlen(argv[i])); |
|
118 | 118 |
if(i != argc-1) |
119 |
- strlcat(opt->filename, " ", len+256); |
|
119 |
+ strncat(opt->filename, " ", 1); |
|
120 | 120 |
} |
121 | 121 |
|
122 | 122 |
} else |
... | ... |
@@ -47,7 +47,6 @@ |
47 | 47 |
#include "str.h" |
48 | 48 |
#include "memory.h" |
49 | 49 |
#include "output.h" |
50 |
-#include "strutil.h" |
|
51 | 50 |
|
52 | 51 |
#define LINE 1024 |
53 | 52 |
|
... | ... |
@@ -482,7 +481,7 @@ int build(struct optstruct *opt) |
482 | 482 |
{ |
483 | 483 |
int ret, no = 0, realno = 0, bytes, itmp; |
484 | 484 |
struct stat foo; |
485 |
- char buffer[FILEBUFF], *tarfile = NULL, *gzfile = NULL, header[513], |
|
485 |
+ char buffer[FILEBUFF], *tarfile = NULL, *gzfile = NULL, header[257], |
|
486 | 486 |
smbuff[30], *pt; |
487 | 487 |
struct cl_node *root = NULL; |
488 | 488 |
FILE *tar, *cvd, *fd; |
... | ... |
@@ -584,7 +583,7 @@ int build(struct optstruct *opt) |
584 | 584 |
|
585 | 585 |
/* magic string */ |
586 | 586 |
|
587 |
- strlcpy(header, "ClamAV-VDB:", sizeof(header)); |
|
587 |
+ strcpy(header, "ClamAV-VDB:"); |
|
588 | 588 |
|
589 | 589 |
/* time */ |
590 | 590 |
|
... | ... |
@@ -592,7 +591,7 @@ int build(struct optstruct *opt) |
592 | 592 |
brokent = localtime(&timet); |
593 | 593 |
setlocale(LC_TIME, "C"); |
594 | 594 |
strftime(smbuff, 30, "%d %b %Y %H-%M %z", brokent); |
595 |
- strlcat(header, smbuff, sizeof(header)); |
|
595 |
+ strcat(header, smbuff); |
|
596 | 596 |
|
597 | 597 |
/* version number */ |
598 | 598 |
|
... | ... |
@@ -606,21 +605,21 @@ int build(struct optstruct *opt) |
606 | 606 |
scanf("%d", &itmp); |
607 | 607 |
sprintf(smbuff, "%d:", itmp); |
608 | 608 |
} |
609 |
- strlcat(header, smbuff, sizeof(header)); |
|
609 |
+ strcat(header, smbuff); |
|
610 | 610 |
|
611 | 611 |
/* number of signatures */ |
612 | 612 |
sprintf(smbuff, "%d:", no); |
613 |
- strlcat(header, smbuff, sizeof(header)); |
|
613 |
+ strcat(header, smbuff); |
|
614 | 614 |
|
615 | 615 |
/* functionality level (TODO: use cl_funclevel()) */ |
616 | 616 |
sprintf(smbuff, "%d:", 1); |
617 |
- strlcat(header, smbuff, sizeof(header)); |
|
617 |
+ strcat(header, smbuff); |
|
618 | 618 |
|
619 | 619 |
/* MD5 */ |
620 | 620 |
pt = cl_md5file(gzfile); |
621 |
- strlcat(header, pt, sizeof(header)); |
|
621 |
+ strcat(header, pt); |
|
622 | 622 |
free(pt); |
623 |
- strlcat(header, ":", sizeof(header)); |
|
623 |
+ strcat(header, ":"); |
|
624 | 624 |
|
625 | 625 |
/* builder - question */ |
626 | 626 |
fflush(stdin); |
... | ... |
@@ -637,17 +636,17 @@ int build(struct optstruct *opt) |
637 | 637 |
exit(1); |
638 | 638 |
} |
639 | 639 |
|
640 |
- strlcat(header, pt, sizeof(header)); |
|
640 |
+ strcat(header, pt); |
|
641 | 641 |
free(pt); |
642 |
- strlcat(header, ":", sizeof(header)); |
|
642 |
+ strcat(header, ":"); |
|
643 | 643 |
|
644 | 644 |
/* builder - add */ |
645 |
- strlcat(header, smbuff, sizeof(header)); |
|
645 |
+ strcat(header, smbuff); |
|
646 | 646 |
|
647 | 647 |
/* fill up with spaces */ |
648 | 648 |
|
649 | 649 |
while(strlen(header) < 512) |
650 |
- strlcat(header, " ", sizeof(header)); |
|
650 |
+ strcat(header, " "); |
|
651 | 651 |
|
652 | 652 |
/* build the final database */ |
653 | 653 |
|