Text  |   XML   |   Visible Warnings:

Pvm : Pvm analysis 1 : Null Pointer Dereference  at pvmd.c:5514

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2672.2719
Similar Warnings: 2672.2720
Procedure: slave_config
Trace: View
Modified: Wed Sep 2 12:42:53 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/src/pvmd.c
   Enter slave_config
 5449 slave_config(hn, argc, argv) 
 5450         char *hn;
 5451         int argc;
 5452         char **argv;
 5453 {
 5454         int lh;                 /* local host index */ 
 5455         int mh;                 /* master host index */ 
 5456         struct hostd *hp;
 5457         int i, j;
 5458         int ac;
 5459         int ms = 0;             /* manual (humanoid) startup */ 
 5460 #ifndef WIN32 
 5461         int dof = 1;            /* fork, exit parent (default) */ 
 5462 #else 
 5463         int dof = 0; 
 5464 #endif 
 5465         int bad = 0;
 5466         char *p;
 5467         char *s;
 5468  
 5469         for (i = j = ac = 1; i < argc; i++) {
 5470                 if (argv[i][0] == '-') {
 5471                         switch (argv[i][1]) {
 5472  
 5473                         case 'S': 
 5474                                 ms = 1;
 5475                                 break;
 5476  
 5477                         case 'f': 
 5478                                 dof = 0;
 5479                                 break;
 5480  
 5481                         default: 
 5482                                 pvmlogprintf("slave_config() unknown switch: %s\n", argv[i]);
 5483                                 bad++;
 5484                         }
 5485  
 5486                 } else {
 5487                         argv[j++] = argv[i];
 5488                         ac++;
 5489                 }
 5490         }
 5491         argc = ac;
 5492  
 5493         if (bad || argc != 6) {
 5494                 pvmlogerror("slave_config: bad args\n");
 5495                 pvmbailout(0);
 5496         }
 5497  
 5498         mh = atoi(argv[1]);
 5499         lh = atoi(argv[4]);
 5500         hosts = ht_new(1);
 5501         hosts->ht_serial = 1;
 5502         hosts->ht_master = mh;
 5503         hosts->ht_cons = mh;
 5504         hosts->ht_local = lh;
 5505  
 5506         hp = hd_new(mh);
 5507         hp->hd_name = STRALLOC("?");   /* Null Pointer Dereference (ID: 2673.2721) */
 5508         hex_inadport(argv[2], &hp->hd_sad);
 5509         hp->hd_mtu = atoi(argv[3]);
 5510         ht_insert(hosts, hp);
 5511         hd_unref(hp);
 5512  
true5513         hp = hd_new(0);
hp <= 40955514         hp->hd_name = STRALLOC("pvmd'");     /* Null Pointer Dereference */
Preconditions
$param_2 >= 3
((char*)&$heap_90272)[8] >= -1
Postconditions
ac' = 6
argc' = 6
argv' = $param_3
atnewline' = 1
bad' = 0
$heap_90272' = 1
bytes_after(&$heap_90272)' = 40
$heap_90272' is allocated by malloc
$heap_90272' is allocated
bytes_before(&$heap_90272)' = 0
strlen(&$heap_90272)' = 0
((char*)&$heap_90272)[16]' = $input_12
((char*)&$heap_90272)[20]' = $input_29292
((char*)&$heap_90272)[24]' = 0
((char*)&$heap_90272)[8]' = ((char*)&$heap_90272)[8] + 1
((char*)&$heap_90272)[12]' = $input_12
$heap_90273' = 1
bytes_after(&$heap_90273)' = 200
$heap_90273' is allocated by malloc
bytes_before(&$heap_90273)' = 0
strlen(&$heap_90273)' = 0
((char*)&$heap_90273)[136]' = &$heap_90277
((char*)&$heap_90273)[152]' = 1
((char*)&$heap_90273)[168]' = 1000
((char*)&$heap_90273)[176]' = &$heap_90274
((char*)&$heap_90273)[8]' = &$heap_90278
((char*)&$heap_90273)[84]' = $input_29300
((char*)&$heap_90273)[88]' = 2
((char*)&$heap_90273)[104]' = 1
((char*)&$heap_90273)[108]' = 1
((char*)&$heap_90273)[112]' = &$heap_90275
((char*)&$heap_90273)[120]' = &$heap_90276
$heap_90274' = &$heap_90274
bytes_after(&$heap_90274)' = 32
$heap_90274' is allocated by malloc
$heap_90274' is allocated
bytes_before(&$heap_90274)' = 0
((char*)&$heap_90274)[16]' = 0
((char*)&$heap_90274)[20]' = 0
((char*)&$heap_90274)[24]' = 0
((char*)&$heap_90274)[8]' = &$heap_90274
bytes_after(&$heap_90275)' = 184
$heap_90275' is allocated by malloc
$heap_90275' is allocated
bytes_before(&$heap_90275)' = 0
((char*)&$heap_90275)[16]' = 0
((char*)&$heap_90275)[176]' = 0
((char*)&$heap_90275)[24]' = 0
((char*)&$heap_90275)[32]' = 0
((char*)&$heap_90275)[40]' = 0
bytes_after(&$heap_90276)' = 184
$heap_90276' is allocated by malloc
$heap_90276' is allocated
bytes_before(&$heap_90276)' = 0
((char*)&$heap_90276)[16]' = 0
((char*)&$heap_90276)[176]' = 0
((char*)&$heap_90276)[24]' = 0
((char*)&$heap_90276)[32]' = 0
((char*)&$heap_90276)[40]' = 0
$heap_90277' = &$heap_90277
bytes_after(&$heap_90277)' = 184
$heap_90277' is allocated by malloc
$heap_90277' is allocated
bytes_before(&$heap_90277)' = 0
((char*)&$heap_90277)[16]' = 0
((char*)&$heap_90277)[176]' = 0
((char*)&$heap_90277)[24]' = 0
((char*)&$heap_90277)[32]' = 0
((char*)&$heap_90277)[40]' = 0
((char*)&$heap_90277)[8]' = &$heap_90277
$heap_90278' = 63
bytes_after(&$heap_90278)' = 2
$heap_90278' is allocated by malloc
$heap_90278' is allocated
bytes_before(&$heap_90278)' = 0
strlen(&$heap_90278)' = 1
$heap_90279' = 112
bytes_after(&$heap_90279)' = 6
$heap_90279' is allocated by malloc
$heap_90279' is allocated
bytes_before(&$heap_90279)' = 0
strlen(&$heap_90279)' = 5
hn' = $param_1
hosts' = &$heap_90272
hp' = 0
i' = $param_2
lh' = $input_29292
mh' = $input_12
tmbuf.tm_sec' = &$unknown_812533




Change Warning 2672.2719 : Null Pointer Dereference

Because they are very similar, this warning shares annotations with warning 2672.2720.

Priority:
State:
Finding:
Owner:
Note: