Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-47391

Coverity analysis defect 114099: Copy into fixed size buffer

    • Fully Compatible
    • ALL
    • Query 2020-09-07

      A source buffer of statically unknown size is copied into a fixed-size destination buffer

      Defect 114099 (STATIC_C)
      Checker STRING_OVERFLOW (subcategory fixed_size_dest)
      File: /src/mongo/scripting/mozjs/jsstringwrapper.cpp
      Function mongo::mozjs::JSStringWrapper::JSStringWrapper(int)
      /src/mongo/scripting/mozjs/jsstringwrapper.cpp, line: 47
      You might overrun the 64-character fixed-size string "this->_buf" by copying the return value of "c_str" without checking the length.

              strcpy(_buf, formatted.c_str());
      

            Assignee:
            claire.childs@mongodb.com Claire Childs (Inactive)
            Reporter:
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: