Text  |   XML   |   Visible Warnings:

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

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2671.2716
Similar Warnings: 2671.2717
Procedure: slave_config
Trace: View
Modified: Wed Sep 2 12:42:51 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  
 5513         hp = hd_new(0);
 5514         hp->hd_name = STRALLOC("pvmd'");   /* Null Pointer Dereference (ID: 2672.2720) */
 5515         hp->hd_arch = STRALLOC(myarchname);   /* Null Pointer Dereference (ID: 2670.2718) */
 5516         hp->hd_mtu = pvmudpmtu;
 5517         hp->hd_dsig = pvmmydsig;
 5518         hex_inadport(argv[5], &hp->hd_sad);
 5519         ht_insert(hosts, hp);
 5520         hd_unref(hp);
 5521  
true5522         hp = hd_new(lh);
hp <= 40955523         hp->hd_name = STRALLOC(hn);     /* Null Pointer Dereference */
Preconditions
$param_2 >= 3
((char*)&$heap_84510)[32] >= 0
((char*)&$heap_84510)[8] >= 0
((char*)&$heap_84511)[144] >= 0
((char*)&$heap_84511)[16] >= 0
((char*)&$heap_84511)[32] = 0
Postconditions
ac' = 6
argc' = 6
argv' = $param_3
atnewline' = 0
bad' = 0
$heap_84510' = 1
bytes_after(&$heap_84510)' = 40
$heap_84510' is allocated by malloc
$heap_84510' is allocated
bytes_before(&$heap_84510)' = 0
strlen(&$heap_84510)' = 0
((char*)&$heap_84510)[16]' = $input_12
((char*)&$heap_84510)[20]' = $input_24492
((char*)&$heap_84510)[24]' = 0
((char*)&$heap_84510)[8]' = ((char*)&$heap_84510)[8] + 1
((char*)&$heap_84510)[12]' = $input_12
$heap_84511' = 0
bytes_after(&$heap_84511)' = 200
$heap_84511' is allocated by malloc
$heap_84511' is freed
bytes_before(&$heap_84511)' = 0
strlen(&$heap_84511)' = 0
((char*)&$heap_84511)[136]' = &$heap_84514
((char*)&$heap_84511)[152]' = 1
((char*)&$heap_84511)[168]' = 1000
((char*)&$heap_84511)[176]' = 0
((char*)&$heap_84511)[8]' = &$heap_84515
((char*)&$heap_84511)[84]' = $input_24500
((char*)&$heap_84511)[88]' = 2
((char*)&$heap_84511)[104]' = 1
((char*)&$heap_84511)[108]' = 1
((char*)&$heap_84511)[112]' = &$heap_84512
((char*)&$heap_84511)[120]' = &$heap_84513
bytes_after(&$heap_84512)' = 184
$heap_84512' is allocated by malloc
bytes_before(&$heap_84512)' = 0
((char*)&$heap_84512)[16]' = 0
((char*)&$heap_84512)[176]' = 0
((char*)&$heap_84512)[24]' = 0
((char*)&$heap_84512)[32]' = 0
((char*)&$heap_84512)[40]' = 0
bytes_after(&$heap_84513)' = 184
$heap_84513' is allocated by malloc
bytes_before(&$heap_84513)' = 0
((char*)&$heap_84513)[176]' = 0
((char*)&$heap_84513)[32]' = 0
((char*)&$heap_84513)[40]' = 0
$heap_84514' = &$heap_84514
bytes_after(&$heap_84514)' = 184
$heap_84514' is allocated by malloc
bytes_before(&$heap_84514)' = 0
((char*)&$heap_84514)[176]' = 0
((char*)&$heap_84514)[32]' = 0
((char*)&$heap_84514)[40]' = 0
((char*)&$heap_84514)[8]' = &$heap_84514
$heap_84515' = 63
bytes_after(&$heap_84515)' = 2
$heap_84515' is allocated by malloc
bytes_before(&$heap_84515)' = 0
strlen(&$heap_84515)' = 1
$heap_84516' = 1
bytes_after(&$heap_84516)' = 200
$heap_84516' is allocated by malloc
bytes_before(&$heap_84516)' = 0
strlen(&$heap_84516)' = 0
((char*)&$heap_84516)[136]' = &$heap_84517
((char*)&$heap_84516)[152]' = 1
((char*)&$heap_84516)[16]' = &$heap_84522
((char*)&$heap_84516)[168]' = 1000
((char*)&$heap_84516)[176]' = &$heap_84518
((char*)&$heap_84516)[76]' = pvmmydsig
((char*)&$heap_84516)[8]' = &$heap_84521
((char*)&$heap_84516)[84]' = pvmudpmtu
((char*)&$heap_84516)[88]' = 2
((char*)&$heap_84516)[104]' = 1
((char*)&$heap_84516)[108]' = 1
((char*)&$heap_84516)[112]' = &$heap_84520
((char*)&$heap_84516)[120]' = &$heap_84519
bytes_after(&$heap_84517)' = 184
$heap_84517' is allocated by malloc
$heap_84517' is allocated
bytes_before(&$heap_84517)' = 0
((char*)&$heap_84517)[16]' = 0
((char*)&$heap_84517)[176]' = 0
((char*)&$heap_84517)[24]' = 0
((char*)&$heap_84517)[32]' = 0
((char*)&$heap_84517)[40]' = 0
$heap_84518' = &$heap_84518
bytes_after(&$heap_84518)' = 32
$heap_84518' is allocated by malloc
$heap_84518' is allocated
bytes_before(&$heap_84518)' = 0
((char*)&$heap_84518)[16]' = 0
((char*)&$heap_84518)[20]' = 0
((char*)&$heap_84518)[24]' = 0
((char*)&$heap_84518)[8]' = &$heap_84518
bytes_after(&$heap_84519)' = 184
$heap_84519' is allocated by malloc
$heap_84519' is allocated
bytes_before(&$heap_84519)' = 0
((char*)&$heap_84519)[16]' = 0
((char*)&$heap_84519)[176]' = 0
((char*)&$heap_84519)[24]' = 0
((char*)&$heap_84519)[32]' = 0
((char*)&$heap_84519)[40]' = 0
bytes_after(&$heap_84520)' = 184
$heap_84520' is allocated by malloc
$heap_84520' is allocated
bytes_before(&$heap_84520)' = 0
((char*)&$heap_84520)[16]' = 0
((char*)&$heap_84520)[176]' = 0
((char*)&$heap_84520)[24]' = 0
((char*)&$heap_84520)[32]' = 0
((char*)&$heap_84520)[40]' = 0
$heap_84521' = 112
bytes_after(&$heap_84521)' = 6
$heap_84521' is allocated by malloc
$heap_84521' is allocated
bytes_before(&$heap_84521)' = 0
strlen(&$heap_84521)' = 5
$heap_84522' = *myarchname
bytes_after(&$heap_84522)' = strlen(myarchname) + 1
$heap_84522' is allocated by malloc
$heap_84522' is allocated
bytes_before(&$heap_84522)' = 0
strlen(&$heap_84522)' = strlen(myarchname)
$heap_84523' = *$param_1
bytes_after(&$heap_84523)' = strlen($param_1) + 1
$heap_84523' is allocated by malloc
$heap_84523' is allocated
bytes_before(&$heap_84523)' = 0
strlen(&$heap_84523)' = strlen($param_1)
hn' = $param_1
hosts' = &$heap_84510
hp' = 0
i' = $param_2
lh' = $input_24492
mh' = $input_12
tmbuf.tm_sec' = &$unknown_810269




Change Warning 2671.2716 : Null Pointer Dereference

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

Priority:
State:
Finding:
Owner:
Note: