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

linenoise_utf8.cpp can read uninitialized memory, trigger Valgrind

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Trivial - P5 Trivial - P5
    • 2.2.3, 2.3.2
    • Affects Version/s: None
    • Component/s: Shell
    • Labels:
      None
    • Fully Compatible
    • ALL

      The copyString32to8counted() routine reads a possible next 32-bit character from its input buffer before checking the count of characters. When called with a non-NUL-terminated string, this character may be uninitialized, triggering tools such as Valgrind to report a problem.

      The count is then checked and the character is ignored if the count indicates that the character is not part of the string to be read, so this is harmless except in edge cases (at page boundaries with the following page an unmapped virtual address).

      The code should should check the count first.

            Assignee:
            tad Tad Marshall
            Reporter:
            tad Tad Marshall
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: