Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-21084

Statement might be overflowing a buffer in strncat

    XMLWordPrintable

    Details

      Description

      Our checker detected a probable buffer overflow in strncat call (storage/connect/reldef.cpp:503:63):

      [ 3291s] I: Statement might be overflowing a buffer in strncat. Common mistake:
      [ 3291s] BAD: strncat(buffer,charptr,sizeof(buffer)) is wrong, it takes the left over size as 3rd argument
      [ 3291s] GOOD: strncat(buffer,charptr,sizeof(buffer)-strlen(buffer)-1)
      [ 3291s] E: mariadb bufferoverflowstrncat /home/abuild/rpmbuild/BUILD/mariadb-10.2.29/storage/connect/reldef.cpp:503:63

      There are probably more of such strncat calls in the MariaDB server so it would be wise to revise all of them.

        Attachments

          Activity

            People

            Assignee:
            bertrandop Olivier Bertrand
            Reporter:
            kstreitova Kristyna Streitova
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: