Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void StringFromPPS(....)
- {
- ...
- sprintf((char *)textPPS,
- "%04X-%04X-%04X-04X-%04X-%04X-%04X-%04X\0",
- *(unsigned long *) (hexString),
- *(unsigned short *)(hexString+4),
- *(unsigned short *)(hexString+4+4),
- *(unsigned short *)(hexString+4+4+4),
- *(unsigned short *)(hexString+4+4+4+4),
- *(unsigned short *)(hexString+4+4+4+4+4),
- *(unsigned short *)(hexString+4+4+4+4+4+4),
- *(unsigned short *)(hexString+4+4+4+4+4+4+4)
- );
- ...
- }
- One of the arguments is 04X instead of %04X.
- This suspicious code was found in amtsdk project by PVS-Studio static code analyzer.
- Warning message is:
- V576 Incorrect format. A different number of actual arguments is expected while calling 'sprintf' function. Expected: 9. Present: 10. ConfigurationServer configurationutils.cpp 236
- 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