Uploaded image for project: 'Log4cxx'
  1. Log4cxx
  2. LOGCXX-105

Infinite loop in string replacing

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 0.10.0
    • 0.10.0
    • None
    • None
    • Linux

    Description

      in file.cpp line 83
      //////////////
      std::string File::convertBackSlashes(const std::string& src) {
      std::string::size_type pos = src.find('
      ');
      if (pos == std::string::npos)

      { return src; }

      std::string mod(src);
      while(pos != std::string::npos)

      { mod[pos] = '/'; pos = src.find('\\'); }

      return mod;
      }
      //////////////
      resolution should be "pos = mod.find("
      ");"
      ////////////
      if the string has more than one "/" src.find return always the first "/" character occurence and the loop "become" infinite

      Attachments

        Activity

          People

            carnold@apache.org Curt Arnold
            alkpone Alban Seurat
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: