Viewing 1 reply thread
  • Author
    Posts
    • #426
      James Mc
      Member

      I found out the hard was that there is a chance to create an infinite loop in the get_directory_list function in class-piklist.php

      The situation where you have a file named fields.php in a plugin, for example, and at the same time have nested directories in /wp-admin/ with the same name (ie: wp-admin/fields/fields) as the file, the get_directory_list function will recurse until it gobbles up all of the available file handles or memory, which ever comes first.

      Its a situation that really never should occur in general, but thought I would just mention it.

      These are the typical warnings you will see if this happens:


      Warning: opendir(fields) [function.opendir]: failed to open dir: Too many open files in /var/www/wp-content/plugins/piklist/includes/class-piklist.php on line 237

      Warning: readdir(): supplied argument is not a valid Directory resource in /var/www/wp-content/plugins/piklist/includes/class-piklist.php on line 239

      Warning: closedir(): supplied argument is not a valid Directory resource in /var/www/wp-content/plugins/piklist/includes/class-piklist.php on line 266

    • #431
      Steve
      Keymaster

      @James_Mc– Agreed, that it’s rare but possible. We’ll look into addressing in a future version. Thanks for the heads up!

Viewing 1 reply thread
  • You must be logged in to reply to this topic.