Uploaded image for project: 'HPCC'
  1. HPCC
  2. HPCC-16433

ConfiguratorMain.cpp buffer not terminated

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.4.0
    • Component/s: Config UI
    • Labels:
      None

      Description

      In main: The string buffer may not have a null terminator if the source string's length is equal to the buffer size (CWE-170)

          memset(pEnvXMLPath, 0, sizeof(pEnvXMLPath));
       86
         	
      CID 1365718 (#1 of 5): Buffer not null terminated (BUFFER_SIZE_WARNING)
      1. buffer_size_warning: Calling strncpy with a maximum size argument of 1024 bytes on destination array pTargetDocExt of size 1024 bytes might leave the destination string unterminated.
       87    strncpy(pTargetDocExt, pDefaultDocExt, sizeof(pTargetDocExt));
       

      The real question is why is this code using fixed length static buffers - it should be using StringBuffer or StringAttr.

        Attachments

          Activity

            People

            • Assignee:
              kenrowland Kenneth A Rowland
              Reporter:
              ghalliday Gavin Halliday
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: