PVS-StudioWarnings

PVS-Studio warning V595 for glibc

Nov 25th, 2014
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.77 KB | None | 0 0
  1. static enum clnt_stat
  2. clntraw_call (h, proc, xargs, argsp, xresults, resultsp, timeout)
  3.      CLIENT *h;
  4.      u_long proc;
  5.      xdrproc_t xargs;
  6.      caddr_t argsp;
  7.      xdrproc_t xresults;
  8.      caddr_t resultsp;
  9.      struct timeval timeout;
  10. {
  11.   struct clntraw_private_s *clp = clntraw_private;
  12.   XDR *xdrs = &clp->xdr_stream;
  13.   ....
  14.   if (clp == NULL)
  15.     return RPC_FAILED;
  16.   ....
  17. }
  18.  
  19. This suspicious code was found in glibc project by PVS-Studio static code analyzer.
  20. Warning message is:
  21. V595 The 'clp' pointer was utilized before it was verified against nullptr. Check lines: 145, 150. clnt_raw.c 145
  22.  
  23. 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