PVS-StudioWarnings

PVS-Studio warning V595 for samba

Nov 10th, 2014
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.85 KB | None | 0 0
  1. static WERROR libnetapi_open_ipc_connection(
  2.               struct libnetapi_ctx *ctx,
  3.               const char *server_name,
  4.               struct client_ipc_connection **pp)
  5. {
  6.   struct libnetapi_private_ctx *priv_ctx =
  7.     (struct libnetapi_private_ctx *)ctx->private_data;
  8.   struct user_auth_info *auth_info = NULL;
  9.   struct cli_state *cli_ipc = NULL;
  10.   struct client_ipc_connection *p;
  11.  
  12.   if (!ctx || !pp || !server_name) {
  13.     return WERR_INVALID_PARAM;
  14.   }
  15.   ....
  16. }
  17.  
  18. This suspicious code was found in samba project by PVS-Studio static code analyzer.
  19. Warning message is:
  20. V595 The 'ctx' pointer was utilized before it was verified against nullptr. Check lines: 67, 72. cm.c 67
  21.  
  22. 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