Advertisement
PVS-StudioWarnings

PVS-Studio warning V114 for NetXMS

Nov 26th, 2014
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | None | 0 0
  1. typedef __time64_t time_t;
  2.  
  3. uint32_t unixtime; /* seconds since 1970 */
  4.  
  5. static int ipfix_print_newmsg(....)
  6. {
  7.   ....
  8.   strftime(timebuf, 40, "%Y-%m-%d %T %Z",
  9.     localtime( (const time_t *) &(hdr->u.nf9.unixtime) ));
  10.   ....
  11. }
  12.  
  13. This suspicious code was found in NetXMS project by PVS-Studio static code analyzer.
  14. Warning message is:
  15. V114 Dangerous explicit type pointer conversion: (const time_t *) & (hdr->u.nf9.unixtime) ipfix_print.c 68
  16.  
  17. 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