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

storage/connect/tabmac.cpp:369: pointless call to strncpy ?

    XMLWordPrintable

Details

    Description

      mariadb-10.2.9/storage/connect/tabmac.cpp:369] -> [mariadb-10.2.9/storage/connect/tabmac.cpp:371]: (performance) Buffer 'buf' is being written before its old content has been used.
      

      Source code is

            if ((p = strstr(adp->Description, " - Packet Scheduler Miniport"))) {
              strncpy(buf, adp->Description, p - adp->Description);
              i = p - adp->Description;
              strncpy(buf, adp->Description, i);
              buf[i] = 0;
      

      The first call to strncpy looks pointless.

      Attachments

        Activity

          People

            bertrandop Olivier Bertrand
            dcb David Binderman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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