Taint enforce: directory open backstops, single-key search filename
[exim.git] / src / src / transports / tf_maildir.c
index 4d5c0c1a9a1960c0aa42e0c2c34f7cb5b6edd689..bcd091b758b9922e07f51147884ee9591a4a3c1a 100644 (file)
@@ -253,15 +253,14 @@ maildir_compute_size(uschar *path, int *filecount, time_t *latest,
 {
 DIR *dir;
 off_t sum = 0;
-struct dirent *ent;
-struct stat statbuf;
 
-if (!(dir = opendir(CS path)))
+if (!(dir = exim_opendir(path)))
   return 0;
 
-while ((ent = readdir(dir)))
+for (struct dirent *ent; ent = readdir(dir); )
   {
   uschar * s, * name = US ent->d_name;
+  struct stat statbuf;
 
   if (Ustrcmp(name, ".") == 0 || Ustrcmp(name, "..") == 0) continue;