https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116936

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2024-10-02
     Ever confirmed|0                           |1
                 CC|                            |dmalcolm at gcc dot gnu.org

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.

```
int
diagnostic_option_classifier::pch_save (FILE *f)
{
  unsigned int lengths[2] = { m_classification_history.length (),
                              m_push_list.length () };
  if (fwrite (lengths, sizeof (lengths), 1, f) != 1
      || fwrite (m_classification_history.address (),
                 sizeof (diagnostic_classification_change_t),
                 lengths[0], f) != lengths[0]
      || fwrite (m_push_list.address (), sizeof (int),
                 lengths[1], f) != lengths[1])
    return -1;
  return 0;
}

```

m_classification_history.address can be a null ptr if the length was 0.

Maybe this is a minor issue but still should be fixed.

Reply via email to