Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-9610

[GCC8] Directive truncation in TTreeFormula

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • High
    • Resolution: Fixed
    • 6.14/02
    • 6.16/00
    • TTree
    • None
    • ArchLinux x86_64, GCC 8.2.0

    Description

      /tmp/root-extra-3066864264136862138/root-extra/src/root-6.14.02/tree/treeplayer/src/TTreeFormula.cxx: In member function ‘Int_t TTreeFormula::FindLeafForExpression(const char*, TLeaf*&, TString&, Bool_t&, UInt_t&, TObjArray&, std::vector<std::__cxx11::basic_string<char> >&, Bool_t&, const char*)’:
      /tmp/root-extra-3066864264136862138/root-extra/src/root-6.14.02/tree/treeplayer/src/TTreeFormula.cxx:2503:46: warning: ‘%s’ directive output may be truncated writing up to 1023 bytes into a region of size between 0 and 1023 [-Wformat-truncation=]
                   snprintf(scratch,sizeof(scratch),"%s.%s",first,work);
                                                    ^~~~~~~       ~~~~
      /tmp/root-extra-3066864264136862138/root-extra/src/root-6.14.02/tree/treeplayer/src/TTreeFormula.cxx:2503:21: note: ‘snprintf’ output between 2 and 2048 bytes into a destination of size 1024
                   snprintf(scratch,sizeof(scratch),"%s.%s",first,work);
                   ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /tmp/root-extra-3066864264136862138/root-extra/src/root-6.14.02/tree/treeplayer/src/TTreeFormula.cxx:2504:48: warning: ‘%s’ directive output may be truncated writing up to 1023 bytes into a region of size between 0 and 1023 [-Wformat-truncation=]
                   snprintf(scratch2,sizeof(scratch2),"%s.%s.%s",first,second,work);
                                                      ^~~~~~~~~~       ~~~~~~
      /tmp/root-extra-3066864264136862138/root-extra/src/root-6.14.02/tree/treeplayer/src/TTreeFormula.cxx:2504:21: note: ‘snprintf’ output between 3 and 3072 bytes into a destination of size 1024
                   snprintf(scratch2,sizeof(scratch2),"%s.%s.%s",first,second,work);
                   ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      [ 92%] Built target FitPanel
      /tmp/root-extra-3066864264136862138/root-extra/src/root-6.14.02/tree/treeplayer/src/TTreeFormula.cxx:2550:23: warning: ‘char* strncat(char*, const char*, size_t)’ output may be truncated copying between 0 and 1023 bytes from a string of length 1023 [-Wstringop-truncation]
                      strncat(second,work,kMaxLen-1-strlen(second));
                      ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /tmp/root-extra-3066864264136862138/root-extra/src/root-6.14.02/tree/treeplayer/src/TTreeFormula.cxx:2579:14: warning: ‘char* strncat(char*, const char*, size_t)’ output may be truncated copying between 0 and 1023 bytes from a string of length 1023 [-Wstringop-truncation]
             strncat(right,work,kMaxLen-1-strlen(right));
             ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      

      Attachments

        Activity

          People

            pcanal Philippe Canal
            kgizdov Konstantin Gizdov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Actual End: