Text  |   XML   |   Visible Warnings:

Pvm : Pvm analysis 1 : Null Pointer Dereference  at cmds.c:497

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2911.2983
Procedure: newalias
Trace: View
Modified: Wed Sep 2 12:52:34 2009   show details
 
Priority: None
State: None
Finding: None
Owner: None
  edit properties

Legend [ X ]
Warning Location
Contributes
Parse Error
Other Warning
Two or More Loop Iterations
On Execution Path
Comment
Macro
Preprocessor
Include
Keyword
Preprocessed Away

Source  |  Language: C Hide Legend     
ProblemLineSource
   /u1/paul/SATE/2010/c/pvm/pvm3/console/cmds.c
   Enter newalias
 484 struct alias * 
 485 newalias(name, num, args) 
 486         char *name;
 487         int num;
 488         char **args;
 489 {
 490         struct alias *ap, *ap2;
 491  
 492         ap = TALLOC(1, struct alias, "alias");
 493         ap->a_name = STRALLOC(name);   /* Null Pointer Dereference (ID: 2912.2985) */
 494         ap->a_args = TALLOC(num + 1, char *, "aargs");
 495         ap->a_num = num;
 496         while (num-- > 0)
true497                 ap->a_args[num] = STRALLOC(args[num]);     /* Null Pointer Dereference */
Preconditions
$param_2 >= 2
Postconditions
ap' = &$heap_239704
args' = $param_3
bytes_after(&$heap_239704)' = 48
$heap_239704' is allocated by malloc
$heap_239704' is allocated
bytes_before(&$heap_239704)' = 0
((char*)&$heap_239704)[16]' = &$heap_239705
((char*)&$heap_239704)[24]' = $param_2
((char*)&$heap_239704)[32]' = &$heap_239706
$heap_239705' = *$param_1
bytes_after(&$heap_239705)' = strlen($param_1) + 1
$heap_239705' is allocated by malloc
$heap_239705' is allocated
bytes_before(&$heap_239705)' = 0
strlen(&$heap_239705)' = strlen($param_1)
bytes_after(&$heap_239706)' = 8 * $param_2 + 8
$heap_239706' is allocated by malloc
$heap_239706' is allocated
bytes_before(&$heap_239706)' = 0
name' = $param_1
num' = 0




Change Warning 2911.2983 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: