Advertisement
PVS-StudioWarnings

PVS-Studio warning V595 for Wine

Nov 27th, 2014
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.78 KB | None | 0 0
  1. static var_t *declare_var(....)
  2. {
  3.   ....
  4.   var_t *v = decl->var;                                 //<==
  5.   expr_list_t *sizes = get_attrp(attrs, ATTR_SIZEIS);
  6.   expr_list_t *lengs = get_attrp(attrs, ATTR_LENGTHIS);
  7.   int sizeless;
  8.   expr_t *dim;
  9.   type_t **ptype;
  10.   array_dims_t *arr = decl ? decl->array : NULL;        //<==
  11.   type_t *func_type = decl ? decl->func_type : NULL;    //<==
  12.   ....
  13. }
  14.  
  15. This suspicious code was found in Wine project by PVS-Studio static code analyzer.
  16. Warning message is:
  17. V595 The 'decl' pointer was utilized before it was verified against nullptr. Check lines: 1411, 1417. parser.y 1411
  18.  
  19. 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