httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r111516 - /httpd/httpd/trunk/support/htcacheclean.c
Date Fri, 10 Dec 2004 15:54:18 GMT
Author: jim
Date: Fri Dec 10 07:54:17 2004
New Revision: 111516

URL: http://svn.apache.org/viewcvs?view=rev&rev=111516
Log:
Dangerous assumption, especially if apr_dir_read uses readdir_r.
Be safe.

Modified:
   httpd/httpd/trunk/support/htcacheclean.c

Modified: httpd/httpd/trunk/support/htcacheclean.c
Url: http://svn.apache.org/viewcvs/httpd/httpd/trunk/support/htcacheclean.c?view=diff&rev=111516&p1=httpd/httpd/trunk/support/htcacheclean.c&r1=111515&p2=httpd/httpd/trunk/support/htcacheclean.c&r2=111516
==============================================================================
--- httpd/httpd/trunk/support/htcacheclean.c	(original)
+++ httpd/httpd/trunk/support/htcacheclean.c	Fri Dec 10 07:54:17 2004
@@ -348,11 +348,9 @@
     }
 
     while (apr_dir_read(&info, 0, dir) == APR_SUCCESS && !interrupted) {
-        /* skip first two entries which will always be '.' and '..' */
-        if (skip < 2) {
-            skip++;
-            continue;
-        }
+        if (!strcmp(info.name, ".") || !strcmp(info.name, "..")) {
+	    continue;
+	}
         d = apr_pcalloc(p, sizeof(DIRENTRY));
         d->basename = apr_pstrcat(p, path, "/", info.name, NULL);
         APR_RING_INSERT_TAIL(&anchor, d, _direntry, link);

Mime
View raw message