Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-26277

Unvalidated file pointer can cause endless loop when passed to feof()

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.1, 2.3
    • Fix Version/s: 2.1.7, 2.2.4
    • Component/s: Gradebook
    • Labels:
    • Environment:
      N/A
    • Testing Instructions:
      Hide

      1. Create a course or enter an existing course.
      2. Create some grades.
      3. Export the grades as a CSV.
      4. Import the grades as a CSV.

      Show
      1. Create a course or enter an existing course. 2. Create some grades. 3. Export the grades as a CSV. 4. Import the grades as a CSV.
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-26277-master

      Description

      As described in http://us2.php.net/manual/en/function.feof.php, passing a bad file pointer to feof can cause an endless loop. File pointers should always be tested before being passed to feof(). The linked patch fixes the two instances I found in the code of pointers not being tested. I'm not aware of anyone actually encountering this bug in the wild so it's more a question of best practices.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Votes:
                16 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  9/Jul/12