Uploaded image for project: 'Core ReactOS'
  1. Core ReactOS
  2. CORE-17143

REG_SZ and REG_MULTI_SZ values not properly null-terminated

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • NTCore
    • None

    Description

      Our kernel and drivers sometimes write registry string values without properly null-terminating them.

      This can be found by e.g. adding a check like this to CmSetValueKey:

          if (Type == REG_SZ)
          {
              ASSERT(DataLength >= sizeof(WCHAR) && ((PWCHAR)Data)[DataLength / sizeof(WCHAR) - 1] == UNICODE_NULL);
          }
          else if (Type == REG_MULTI_SZ)
          {
              ASSERT(DataLength >= sizeof(WCHAR) && ((PWCHAR)Data)[DataLength / sizeof(WCHAR) - 1] == UNICODE_NULL);
              ASSERT(DataLength >= 2*sizeof(WCHAR) && ((PWCHAR)Data)[DataLength / sizeof(WCHAR) - 2] == UNICODE_NULL);
          }
      

      Attachments

        Activity

          People

            ThFabba ThFabba
            ThFabba ThFabba
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: