Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- VOID
- ReportToString(
- PHID_DATA pData,
- _Inout_updates_bytes_(iBuffSize) LPSTR szBuff,
- UINT iBuffSize
- )
- {
- ....
- if(FAILED(StringCbPrintf (szBuff,
- iBuffSize,
- "Usage Page: 0x%x, Usages: ",
- pData -> UsagePage)))
- {
- for(j=0; j<sizeof(szBuff); j++)
- {
- szBuff[j] = '\0';
- }
- return;
- }
- ....
- }
- Most likely this is what should be written here: for(j=0; j<iBuffSize; j++)
- This suspicious code was found in DDKSamples project by PVS-Studio static code analyzer.
- Warning message is:
- V604 It is odd that the number of iterations in the loop equals to the size of the 'szBuff' pointer. hclient.c 1688
- 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