Coverity analysis defect 114099: Copy into fixed size buffer

XMLWordPrintableJSON

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

      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 (Inactive)
              Reporter:
              Coverity Collector User
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: