Text  |   XML   |   Visible Warnings:

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

Categories: LANG.MEM.NPD CWE:476
Warning ID: 261.28913
Similar Warnings: 261.28912
Procedure: slave_config
Trace: view
Modified: Thu Nov 26 11:28:30 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);
true5514         hp->hd_name = STRALLOC("pvmd'");     /* Null Pointer Dereference */
Preconditions
argc >= 3
*argv[2] != 58
((char*)&$heap_172695)[96] >= 0
((char*)&$heap_172695)[12] >= 0
Postconditions
ac' = 6
argc' = 6
atnewline' = 0
bad' = 0
errno' != 0
$heap_172691' = 1
bytes_after(&$heap_172691)' = 32
$heap_172691' is allocated by malloc
$heap_172691' is allocated
bytes_before(&$heap_172691)' = 0
((char*)&$heap_172691)[16]' = $input_12
((char*)&$heap_172691)[20]' = $input_105116
((char*)&$heap_172691)[12]' = $input_12
bytes_after(&$heap_172692)' = 120
$heap_172692' is allocated by malloc
bytes_before(&$heap_172692)' = 0
((char*)&$heap_172692)[16]' = 0
((char*)&$heap_172692)[20]' = 0
((char*)&$heap_172692)[116]' = 0
bytes_after(&$heap_172693)' = 120
$heap_172693' is allocated by malloc
bytes_before(&$heap_172693)' = 0
((char*)&$heap_172693)[16]' = 0
((char*)&$heap_172693)[4]' = &$heap_172693
bytes_after(&$heap_172694)' = 120
$heap_172694' is allocated by malloc
bytes_before(&$heap_172694)' = 0
((char*)&$heap_172694)[16]' = 0
((char*)&$heap_172694)[20]' = 0
((char*)&$heap_172694)[8]' = 0
((char*)&$heap_172694)[116]' = 0
((char*)&$heap_172694)[12]' = 0
$heap_172695' = 0
bytes_after(&$heap_172695)' = 124
$heap_172695' is allocated by malloc
$heap_172695' is freed
bytes_before(&$heap_172695)' = 0
((char*)&$heap_172695)[52]' = $input_105124
((char*)&$heap_172695)[56]' = 2
((char*)&$heap_172695)[72]' = 1
((char*)&$heap_172695)[76]' = 1
((char*)&$heap_172695)[80]' = &$heap_172694
((char*)&$heap_172695)[8]' = &$heap_172697
((char*)&$heap_172695)[84]' = &$heap_172693
((char*)&$heap_172695)[92]' = &$heap_172692
((char*)&$heap_172695)[100]' = 1
((char*)&$heap_172695)[108]' = 1000
((char*)&$heap_172695)[112]' = &$heap_172696
bytes_after(&$heap_172696)' = 20
$heap_172696' is allocated by malloc
bytes_before(&$heap_172696)' = 0
((char*)&$heap_172696)[16]' = 0
((char*)&$heap_172696)[8]' = 0
((char*)&$heap_172696)[12]' = 0
$heap_172697' = 63
bytes_after(&$heap_172697)' = 2
$heap_172697' is allocated by malloc
bytes_before(&$heap_172697)' = 0
strlen(&$heap_172697)' = 1
tocttou($heap_172697)' = tocttou(#string176)
bytes_after(&$heap_172698)' = 120
$heap_172698' is allocated by malloc
$heap_172698' is allocated
bytes_before(&$heap_172698)' = 0
((char*)&$heap_172698)[16]' = 0
((char*)&$heap_172698)[20]' = 0
((char*)&$heap_172698)[8]' = 0
((char*)&$heap_172698)[116]' = 0
((char*)&$heap_172698)[12]' = 0
bytes_after(&$heap_172699)' = 120
$heap_172699' is allocated by malloc
$heap_172699' is allocated
bytes_before(&$heap_172699)' = 0
((char*)&$heap_172699)[16]' = 0
((char*)&$heap_172699)[20]' = 0
((char*)&$heap_172699)[8]' = 0
((char*)&$heap_172699)[116]' = 0
((char*)&$heap_172699)[12]' = 0
bytes_after(&$heap_172700)' = 20
$heap_172700' is allocated by malloc
$heap_172700' is allocated
bytes_before(&$heap_172700)' = 0
((char*)&$heap_172700)[16]' = 0
((char*)&$heap_172700)[8]' = 0
((char*)&$heap_172700)[12]' = 0
bytes_after(&$heap_172701)' = 120
$heap_172701' is allocated by malloc
$heap_172701' is allocated
bytes_before(&$heap_172701)' = 0
((char*)&$heap_172701)[16]' = 0
((char*)&$heap_172701)[20]' = 0
((char*)&$heap_172701)[8]' = 0
((char*)&$heap_172701)[116]' = 0
((char*)&$heap_172701)[12]' = 0
$heap_172702' = 1
bytes_after(&$heap_172702)' = 124
$heap_172702' is allocated by malloc
$heap_172702' is allocated
bytes_before(&$heap_172702)' = 0
((char*)&$heap_172702)[56]' = 2
((char*)&$heap_172702)[72]' = 1
((char*)&$heap_172702)[76]' = 1
((char*)&$heap_172702)[80]' = &$heap_172701
((char*)&$heap_172702)[84]' = &$heap_172699
((char*)&$heap_172702)[92]' = &$heap_172698
((char*)&$heap_172702)[100]' = 1
((char*)&$heap_172702)[108]' = 1000
((char*)&$heap_172702)[112]' = &$heap_172700
hosts' = &$heap_172691
hp' = &$heap_172702
i' = argc
lh' = $input_105116
mh' = $input_12
tmbuf.tm_sec' = &$unknown_733321




Change Warning 261.28913 : Null Pointer Dereference

Because they are very similar, this warning shares annotations with warning 261.28912.
CodeSonar has selected warning 261.28912 to represent this group of similar warnings. In order to edit this group, you must edit warning 261.28912.