Advertisement
PVS-StudioWarnings

PVS-Studio warning V576 for glibc

Nov 27th, 2014
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. typedef unsigned int __uid_t;
  2. typedef __uid_t uid_t;
  3.  
  4. int
  5. user2netname (...., const uid_t uid, ....)
  6. {
  7.   ....
  8.   sprintf (netname, "%s.%d@%s", OPSYS, uid, dfltdom);
  9.   ....
  10. }
  11.  
  12. This suspicious code was found in glibc project by PVS-Studio static code analyzer.
  13. Warning message is:
  14. V576 Incorrect format. Consider checking the fourth actual argument of the 'sprintf' function. The SIGNED integer type argument is expected. netname.c 51
  15.  
  16. 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