mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 17:25:55 +00:00
[SMSS] Use RTL string-safe functions in critical places. Add validity checks for returned NtQueryValueKey() data. (#2704)
- Not all the wcscpy() / swprintf() calls have been converted to their string-safe equivalents. Instead I used the string-safe functions only for places where strings of unknown length were copied into fixed-size internal buffers. On the contrary, for known-fixed-length strings being copied or numbers being converted to string representations in large enough buffers, I kept the original function calls. - Verify the registry data that has been returned by NtQueryValueKey(): * When expecting (not multi) strings, check whether the data type is either REG_SZ or REG_EXPAND_SZ. * When expecting DWORD values, check whether the data type is REG_DWORD and whether the data length is (greater or) equal to sizeof(ULONG).
This commit is contained in:
parent
8ee0ee6a88
commit
87e2ec585f
5 changed files with 80 additions and 44 deletions
|
@ -94,7 +94,7 @@ SmpSbCreateSession(IN PVOID Reserved,
|
|||
NtClose(ProcessInformation->ProcessHandle);
|
||||
NtClose(ProcessInformation->ThreadHandle);
|
||||
SmpDereferenceSubsystem(KnownSubsys);
|
||||
DbgPrint("SmpSbCreateSession: NtDuplicateObject (Thread) Failed %lx\n", Status);
|
||||
DPRINT1("SmpSbCreateSession: NtDuplicateObject (Thread) Failed %lx\n", Status);
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue