Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Null Pointer Dereference  at pvmd.c:5523

Categories: LANG.MEM.NPD CWE:476
Warning ID: 259.28909
Similar Warnings: 259.28910
Procedure: slave_config
Trace: view
Modified: Thu Nov 26 11:28:29 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
   /kat0/fletcher/SATE/2010/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: 262.28915) */
 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: 261.28913) */
 5515         hp->hd_arch = STRALLOC(myarchname);   /* Null Pointer Dereference (ID: 260.28911) */
 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
argc >= 3
*argv[2] != 58
((char*)&$heap_165508)[96] >= 0
((char*)&$heap_165508)[12] >= 0
Postconditions
ac' = 6
argc' = 6
atnewline' = 0
bad' = 0
errno' != 0
$heap_165505' = 1
bytes_after(&$heap_165505)' = 32
$heap_165505' is allocated by malloc
$heap_165505' is allocated
bytes_before(&$heap_165505)' = 0
((char*)&$heap_165505)[16]' = $input_12
((char*)&$heap_165505)[20]' = $input_99324
((char*)&$heap_165505)[24]' >= 0
((char*)&$heap_165505)[24]' <= 1
((char*)&$heap_165505)[8]' = ((char*)&$heap_165505)[8] + 1
((char*)&$heap_165505)[12]' = $input_12
bytes_after(&$heap_165506)' = 120
$heap_165506' is allocated by malloc
bytes_before(&$heap_165506)' = 0
((char*)&$heap_165506)[16]' = 0
((char*)&$heap_165506)[20]' = 0
((char*)&$heap_165506)[8]' = 0
((char*)&$heap_165506)[116]' = 0
((char*)&$heap_165506)[12]' = 0
bytes_after(&$heap_165507)' = 120
$heap_165507' is allocated by malloc
bytes_before(&$heap_165507)' = 0
((char*)&$heap_165507)[16]' = 0
$heap_165508' = 0
bytes_after(&$heap_165508)' = 124
$heap_165508' is allocated by malloc
$heap_165508' is freed
bytes_before(&$heap_165508)' = 0
((char*)&$heap_165508)[52]' = $input_99332
((char*)&$heap_165508)[56]' = 2
((char*)&$heap_165508)[72]' = 1
((char*)&$heap_165508)[76]' = 1
((char*)&$heap_165508)[80]' = &$heap_165506
((char*)&$heap_165508)[8]' = &$heap_165510
((char*)&$heap_165508)[84]' = &$heap_165507
((char*)&$heap_165508)[92]' = &$heap_165509
((char*)&$heap_165508)[100]' = 1
((char*)&$heap_165508)[108]' = 1000
((char*)&$heap_165508)[112]' = 0
bytes_after(&$heap_165509)' = 120
$heap_165509' is allocated by malloc
bytes_before(&$heap_165509)' = 0
((char*)&$heap_165509)[16]' = 0
((char*)&$heap_165509)[20]' = 0
((char*)&$heap_165509)[116]' = 0
$heap_165510' = 63
bytes_after(&$heap_165510)' = 2
$heap_165510' is allocated by malloc
bytes_before(&$heap_165510)' = 0
strlen(&$heap_165510)' = 1
tocttou($heap_165510)' = tocttou(#string176)
bytes_after(&$heap_165511)' = 120
$heap_165511' is allocated by malloc
$heap_165511' is allocated
bytes_before(&$heap_165511)' = 0
((char*)&$heap_165511)[16]' = 0
((char*)&$heap_165511)[20]' = 0
((char*)&$heap_165511)[8]' = 0
((char*)&$heap_165511)[116]' = 0
((char*)&$heap_165511)[12]' = 0
$heap_165512' = &$heap_165512
bytes_after(&$heap_165512)' = 120
$heap_165512' is allocated by malloc
$heap_165512' is allocated
bytes_before(&$heap_165512)' = 0
((char*)&$heap_165512)[16]' = 0
((char*)&$heap_165512)[20]' = 0
((char*)&$heap_165512)[4]' = &$heap_165512
((char*)&$heap_165512)[8]' = 0
((char*)&$heap_165512)[116]' = 0
((char*)&$heap_165512)[12]' = 0
bytes_after(&$heap_165513)' = 20
$heap_165513' is allocated by malloc
$heap_165513' is allocated
bytes_before(&$heap_165513)' = 0
((char*)&$heap_165513)[16]' = 0
((char*)&$heap_165513)[8]' = 0
((char*)&$heap_165513)[12]' = 0
bytes_after(&$heap_165514)' = 120
$heap_165514' is allocated by malloc
$heap_165514' is allocated
bytes_before(&$heap_165514)' = 0
((char*)&$heap_165514)[16]' = 0
((char*)&$heap_165514)[20]' = 0
((char*)&$heap_165514)[8]' = 0
((char*)&$heap_165514)[116]' = 0
((char*)&$heap_165514)[12]' = 0
$heap_165515' = 1
bytes_after(&$heap_165515)' = 124
$heap_165515' is allocated by malloc
bytes_before(&$heap_165515)' = 0
((char*)&$heap_165515)[44]' = pvmmydsig
((char*)&$heap_165515)[52]' = pvmudpmtu
((char*)&$heap_165515)[56]' = 2
((char*)&$heap_165515)[72]' = 1
((char*)&$heap_165515)[76]' = 1
((char*)&$heap_165515)[80]' = &$heap_165514
((char*)&$heap_165515)[8]' = &$heap_165516
((char*)&$heap_165515)[84]' = &$heap_165512
((char*)&$heap_165515)[92]' = &$heap_165511
((char*)&$heap_165515)[100]' = 1
((char*)&$heap_165515)[108]' = 1000
((char*)&$heap_165515)[112]' = &$heap_165513
((char*)&$heap_165515)[12]' = &$heap_165517
$heap_165516' = 112
bytes_after(&$heap_165516)' = 6
$heap_165516' is allocated by malloc
$heap_165516' is allocated
bytes_before(&$heap_165516)' = 0
strlen(&$heap_165516)' = 5
tocttou($heap_165516)' = tocttou(#string167)
$heap_165517' = *myarchname
bytes_after(&$heap_165517)' = strlen(myarchname) + 1
$heap_165517' is allocated by malloc
$heap_165517' is allocated
bytes_before(&$heap_165517)' = 0
strlen(&$heap_165517)' = strlen(myarchname)
tocttou($heap_165517)' = tocttou(*myarchname)
$heap_165518' = *hn
bytes_after(&$heap_165518)' = strlen(hn) + 1
$heap_165518' is allocated by malloc
$heap_165518' is allocated
bytes_before(&$heap_165518)' = 0
strlen(&$heap_165518)' = strlen(hn)
tocttou($heap_165518)' = tocttou(*hn)
hosts' = &$heap_165505
hp' = 0
i' = argc
lh' = $input_99324
mh' = $input_12
tmbuf.tm_sec' = &$unknown_732689




Change Warning 259.28909 : Null Pointer Dereference

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

Priority:
State:
Finding:
Owner:
Note: