Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static const PCHAR Nv11Board = "NV11 (GeForce2) Board";
- static const PCHAR Nv11Chip = "Chip Rev B2";
- static const PCHAR Nv11Vendor = "NVidia Corporation";
- BOOLEAN
- IsVesaBiosOk(....)
- {
- ...
- if (!(strncmp(Vendor, Nv11Vendor, sizeof(Nv11Vendor))) &&
- !(strncmp(Product, Nv11Board, sizeof(Nv11Board))) &&
- !(strncmp(Revision, Nv11Chip, sizeof(Nv11Chip))) &&
- (OemRevision == 0x311))
- ...
- }
- The error is this: sizeof() returns the pointer size, not string length.
- This suspicious code was found in ReactOS project by PVS-Studio static code analyzer.
- Warning message is:
- V579 The strncmp function receives the pointer and its size as arguments. It is possibly a mistake. Inspect the third argument. vga vbe.c 57
- 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