Browse code

only when there are at least 2 chars in pathname.

git-svn: trunk@4853

Török Edvin authored on 2009/02/24 22:24:54
Showing 2 changed files
... ...
@@ -1,3 +1,8 @@
1
+Tue Feb 24 15:57:43 EET 2009 (edwin)
2
+------------------------------------
3
+ * libclamav/others_common.c: only when there are at least 2 chars in
4
+ pathname.
5
+
1 6
 Tue Feb 24 15:54:17 EET 2009 (edwin)
2 7
 ------------------------------------
3 8
  * clamdscan/client.c, clamdscan/proto.c, clamdscan/proto.h,
... ...
@@ -505,10 +505,10 @@ int cli_ftw(char *path, int flags, int maxdepth, cli_ftw_cb callback, struct cli
505 505
 
506 506
     int ret;
507 507
 
508
-    if (flags & CLI_FTW_TRIM_SLASHES) {
508
+    if ((flags & CLI_FTW_TRIM_SLASHES) && path[0] && path[1]) {
509
+	char *pathend;
509 510
 	/* trim slashes so that dir and dir/ behave the same when
510 511
 	 * they are symlinks, and we are not following symlinks */
511
-	char *pathend;
512 512
 	while (path[0] == '/' && path[1] == '/') path++;
513 513
 	pathend = path + strlen(path);
514 514
 	while (pathend > path && pathend[-1] == '/') --pathend;