Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-16735

Trying to access array offset on value of type bool

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 4.0.0-a1, 3.3.4-RC1
    • 3.3.4
    • None
    • None

    Description

      I had this error when doing login with incorrect username

       

       

      This is caused in file  around line 140 with this code

      $sql = 'SELECT *
       FROM ' . USERS_TABLE . "
       WHERE username_clean = '" . $this->db->sql_escape($username_clean) . "'";
       $result = $this->db->sql_query($sql);
       $row = $this->db->sql_fetchrow($result);
       $this->db->sql_freeresult($result);

      $row is false, so when executing this like

      $show_captcha = $row !== false && ($this->config['max_login_attempts'] && $row['user_login_attempts'] >= $this->config['max_login_attempts']) ||
       ($this->config['ip_login_limit_max'] && $attempts >= $this->config['ip_login_limit_max']);

      is not possible to access to false['user_login_attempts']

       

      Caused by: https://github.com/phpbb/phpbb/pull/6155

      Attachments

        Activity

          People

            Marc Marc
            rubencm rubencm
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: