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

mariadb-10.5.6/storage/connect/plugutil.cpp:380: bad width ?

Details

    Description

      mariadb-10.5.6/storage/connect/plugutil.cpp:380:7: error: Width 256 given in format string (no. 1) is larger than destination buffer 'msgid[32]', use %31s to prevent overflowing it. [invalidScanfFormatWidth]

      Source code is

        if (sscanf(buff, " %*d %-.256s \"%[^\"]", msgid, stmsg) < 2) {
      

      Attachments

        Activity

          dcb you can create PR https://github.com/MariaDB/server/pulls to solve all from ^ .

          anel Anel Husakovic added a comment - dcb you can create PR https://github.com/MariaDB/server/pulls to solve all from ^ .

          Thanks for the offer to create a PR, but I will decline that one.

          I've reported a bug and pointed developers towards cppcheck.
          It finds about 1,200 errors and 3,500 warnings in mariadb,
          so the folks that know the mariadb code well might be busy fixing
          a few of the more important problems it finds.

          dcb David Binderman added a comment - Thanks for the offer to create a PR, but I will decline that one. I've reported a bug and pointed developers towards cppcheck. It finds about 1,200 errors and 3,500 warnings in mariadb, so the folks that know the mariadb code well might be busy fixing a few of the more important problems it finds.
          serg Sergei Golubchik added a comment - https://github.com/MariaDB/server/commit/792be8a0957

          Possible 2 * off by one error in commit.

          May I refer Sergei to the original message by cppcheck. 31 not 32 and probably 255, not 256.

          dcb David Binderman added a comment - Possible 2 * off by one error in commit. May I refer Sergei to the original message by cppcheck. 31 not 32 and probably 255, not 256.
          serg Sergei Golubchik added a comment - - edited

          no problem, it wasn't pushed yet

          upd: https://github.com/MariaDB/server/commit/79fd338e6ca

          serg Sergei Golubchik added a comment - - edited no problem, it wasn't pushed yet upd: https://github.com/MariaDB/server/commit/79fd338e6ca

          People

            serg Sergei Golubchik
            dcb David Binderman
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.