PVS-StudioWarnings

PVS-Studio warning V638 for VirtualBox

Nov 13th, 2014
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.81 KB | None | 0 0
  1. static struct AppleSMCData data[] =
  2. {
  3.   {6, "REV ", "\0x01\0x13\0x0f\0x00\0x00\0x03"},  //<==
  4.   {32,"OSK0", osk },
  5.   {32,"OSK1", osk+32 },
  6.   {1, "NATJ",  "\0" },
  7.   {1, "MSSP",  "\0" },
  8.   {1, "MSSD",  "\0x3" },                          //<==
  9.   {1, "NTOK",  "\0"},
  10.   {0, NULL,    NULL }
  11. };
  12.  
  13. Most likely this is what should be written here: {6, "REV ", "\x01\x13\x0f\x00\x00\x03"} .... {1, "MSSD",  "\x3" } ....
  14.  
  15. This suspicious code was found in VirtualBox project by PVS-Studio static code analyzer.
  16. Warning message is:
  17. V638 A terminal null is present inside a string. The '\0x01' characters were encountered. Probably meant: '\x01'. devsmc.cpp 129
  18.  
  19. 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