Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- BOOL PrepareService(LPCTSTR ServiceName)
- {
- DWORD LeftOfBuffer = sizeof(ServiceKeyBuffer) /
- sizeof(ServiceKeyBuffer[0]);
- ....
- LeftOfBuffer -= _tcslen(SERVICE_KEY);
- ....
- LeftOfBuffer -= _tcslen(ServiceName);
- ....
- LeftOfBuffer -= _tcslen(PARAMETERS_KEY);
- ....
- if (LeftOfBuffer < 0)
- {
- DPRINT1("Buffer overflow for service name: '%s'\n",
- ServiceName);
- return FALSE;
- }
- ....
- }
- There are a lot of such fragments in ReactOS, but I cannot say for sure how critical they are.
- This suspicious code was found in ReactOS project by PVS-Studio static code analyzer.
- Warning message is:
- V547 Expression 'LeftOfBuffer < 0' is always false. Unsigned type value is never < 0. svchost svchost.c 56
- PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement