Text  |   XML   |   Visible Warnings:

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

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2681.2730
Procedure: colonsep
Trace: View
Modified: Wed Sep 2 12:43:18 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 master_config
 5317 master_config(hn, argc, argv) 
 5318         char *hn;                       /* hostname or null */ 
 5319         int argc;
 5320         char **argv;
 5321 {
 5322         struct hostent *he;
 5323         struct hostd *hp;
 5324         struct hostd *hp2;
 5325         int i;
 5326         char *s;
 5327  
 5328         if (argc > 2) {
 5329                 pvmlogerror("usage: pvmd3 [-ddebugmask] [-nhostname] [hostfile]\n");
 5330                 pvmbailout(0);
 5331         }
 5332         if (argc == 2) {
 5333                 filehosts = readhostfile(argv[1]);
 5334         }
 5335         else if (s = getenv("PVMHOSTFILE")) {
 5336                 filehosts = readhostfile(s);
 5337         }
 5338         if (pvmdebmask & PDMSTARTUP) {
 5339                 if (filehosts) {
 5340                         pvmlogerror("master_config() host file:\n");
 5341                         ht_dump(filehosts);
 5342  
 5343                 } else 
 5344                         pvmlogerror("master_config() null host file\n");
 5345         }
 5346  
 5347         hosts = ht_new(1);
 5348         hosts->ht_serial = 1;
 5349         hosts->ht_master = 1;
 5350         hosts->ht_cons = 1;
 5351         hosts->ht_local = 1;
 5352  
 5353         hp = hd_new(1);
 5354         hp->hd_name = STRALLOC(hn);   /* Null Pointer Dereference (ID: 2687.2738) */
 5355         hp->hd_arch = STRALLOC(myarchname);   /* Null Pointer Dereference (ID: 2685.2737) */
 5356         hp->hd_mtu = pvmudpmtu;
 5357         hp->hd_dsig = pvmmydsig;
 5358         ht_insert(hosts, hp);
 5359         hd_unref(hp);
 5360  
 5361         hp = hd_new(0);
 5362         hp->hd_name = STRALLOC("pvmd'");   /* Null Pointer Dereference (ID: 2686.2736) */
 5363         hp->hd_arch = STRALLOC(myarchname);   /* Null Pointer Dereference (ID: 2685.2734) */
 5364         hp->hd_mtu = pvmudpmtu;
 5365         hp->hd_dsig = pvmmydsig;
 5366         ht_insert(hosts, hp);
 5367         hd_unref(hp);
 5368  
 5369         /*
 5370         * get attributes from host file if available 
 5371         */ 
 5372  
 5373         hp = hosts->ht_hosts[1];
 5374         if (filehosts &&
 5375                         ((hp2 = nametohost(filehosts, hp->hd_name)) 
 5376                         || (hp2 = filehosts->ht_hosts[0]))) {
 5377                 applydefaults(hp, hp2);
 5378         }
 5379  
 5380         if (!hp->hd_epath) {
 5381                 if ((s = getenv("PVM_PATH")))
 5382                         hp->hd_epath = STRALLOC(s);   /* Null Pointer Dereference (ID: 2683.2732) */
 5383                 else 
 5384                         hp->hd_epath = STRALLOC(DEFBINDIR);   /* Null Pointer Dereference (ID: 2682.2731) */
 5385         }
true5386         epaths = colonsep(varsub(hp->hd_epath));
     Enter master_config / colonsep
 5167   char ** 
$param_1 <= 40955168   colonsep(s) 
 5169           char *s;        /* the string to break up */ 
 5170   {
 5171           char **els;
 5172           int nel = 2;                    /* length of els */ 
 5173           char *p, *q;
 5174    
 5175   #if defined (IMA_OS2) || defined (WIN32) 
 5176           for (p = s; p = CINDEX(p, ';'); p++) 
 5177   #else 
s <= 40955178           for (p = s; p = CINDEX(p, ':'); p++)     /* Null Pointer Dereference */  /* Null Pointer Dereference (ID: 2553.2584) */
     Exit master_config / colonsep
Preconditions
$param_2 = 2
&$unknown_867385 != 0
strlen(((char*)&((char*)$unknown_867381)[8])[8]) > 0
((char*)&$unknown_867360)[4] >= 1
$unknown_867383 != 0
$unknown_867383 != 36
strlen(&$unknown_867383) = 1
((char*)&$unknown_867383)[1] = 0
((char*)&$heap_132632)[8] >= 0
((char*)&$heap_132634)[144] >= 0
((char*)&$heap_132634)[32] = 0
((char*)&$heap_132641)[144] >= 0
((char*)&$heap_132641)[32] = 0
$input_12 >= 1
$input_60 = &$unknown_867385
Postconditions
((char*)&((char*)$unknown_867381)[8])[192]' = &$heap_132648
((char*)&((char*)$unknown_867381)[8])[40]' = &$heap_132650
argc' = $param_2
argv' = $param_3
filehosts' = &$unknown_867360
$heap_132632' = 1
bytes_after(&$heap_132632)' = 40
$heap_132632' is allocated by malloc
$heap_132632' is allocated
bytes_before(&$heap_132632)' = 0
strlen(&$heap_132632)' = 0
((char*)&$heap_132632)[16]' = 1
((char*)&$heap_132632)[20]' = 1
((char*)&$heap_132632)[32]' = &$unknown_867381
((char*)&$heap_132632)[12]' = 1
$heap_132634' = 0
bytes_after(&$heap_132634)' = 200
$heap_132634' is allocated by malloc
$heap_132634' is freed
bytes_before(&$heap_132634)' = 0
strlen(&$heap_132634)' = 0
((char*)&$heap_132634)[136]' = &$heap_132636
((char*)&$heap_132634)[152]' = 1
((char*)&$heap_132634)[16]' = &$heap_132640
((char*)&$heap_132634)[168]' = 1000
((char*)&$heap_132634)[176]' = &$heap_132637
((char*)&$heap_132634)[76]' = pvmmydsig
((char*)&$heap_132634)[8]' = &$heap_132639
((char*)&$heap_132634)[84]' = pvmudpmtu
((char*)&$heap_132634)[88]' = 2
((char*)&$heap_132634)[104]' = 1
((char*)&$heap_132634)[108]' = 1
((char*)&$heap_132634)[112]' = &$heap_132635
((char*)&$heap_132634)[120]' = &$heap_132638
bytes_after(&$heap_132635)' = 184
$heap_132635' is allocated by malloc
bytes_before(&$heap_132635)' = 0
((char*)&$heap_132635)[16]' = 0
((char*)&$heap_132635)[176]' = 0
((char*)&$heap_132635)[24]' = 0
((char*)&$heap_132635)[32]' = 0
((char*)&$heap_132635)[40]' = 0
$heap_132636' = &$heap_132636
bytes_after(&$heap_132636)' = 184
$heap_132636' is allocated by malloc
bytes_before(&$heap_132636)' = 0
((char*)&$heap_132636)[176]' = 0
((char*)&$heap_132636)[32]' = 0
((char*)&$heap_132636)[40]' = 0
((char*)&$heap_132636)[8]' = &$heap_132636
bytes_after(&$heap_132637)' = 32
$heap_132637' is allocated by malloc
bytes_before(&$heap_132637)' = 0
((char*)&$heap_132637)[16]' = 0
((char*)&$heap_132637)[20]' = 0
((char*)&$heap_132637)[24]' = 0
bytes_after(&$heap_132638)' = 184
$heap_132638' is allocated by malloc
bytes_before(&$heap_132638)' = 0
((char*)&$heap_132638)[176]' = 0
((char*)&$heap_132638)[32]' = 0
((char*)&$heap_132638)[40]' = 0
$heap_132639' = *$param_1
bytes_after(&$heap_132639)' = strlen($param_1) + 1
$heap_132639' is allocated by malloc
bytes_before(&$heap_132639)' = 0
strlen(&$heap_132639)' = strlen($param_1)
$heap_132640' = *myarchname
bytes_after(&$heap_132640)' = strlen(myarchname) + 1
$heap_132640' is allocated by malloc
bytes_before(&$heap_132640)' = 0
strlen(&$heap_132640)' = strlen(myarchname)
$heap_132641' = 0
bytes_after(&$heap_132641)' = 200
$heap_132641' is allocated by malloc
$heap_132641' is freed
bytes_before(&$heap_132641)' = 0
strlen(&$heap_132641)' = 0
((char*)&$heap_132641)[136]' = &$heap_132645
((char*)&$heap_132641)[152]' = 1
((char*)&$heap_132641)[16]' = &$heap_132647
((char*)&$heap_132641)[168]' = 1000
((char*)&$heap_132641)[176]' = &$heap_132644
((char*)&$heap_132641)[76]' = pvmmydsig
((char*)&$heap_132641)[8]' = &$heap_132646
((char*)&$heap_132641)[84]' = pvmudpmtu
((char*)&$heap_132641)[88]' = 2
((char*)&$heap_132641)[104]' = 1
((char*)&$heap_132641)[108]' = 1
((char*)&$heap_132641)[112]' = &$heap_132643
((char*)&$heap_132641)[120]' = &$heap_132642
bytes_after(&$heap_132642)' = 184
$heap_132642' is allocated by malloc
bytes_before(&$heap_132642)' = 0
((char*)&$heap_132642)[176]' = 0
((char*)&$heap_132642)[32]' = 0
((char*)&$heap_132642)[40]' = 0
bytes_after(&$heap_132643)' = 184
$heap_132643' is allocated by malloc
bytes_before(&$heap_132643)' = 0
((char*)&$heap_132643)[16]' = 0
((char*)&$heap_132643)[176]' = 0
((char*)&$heap_132643)[24]' = 0
((char*)&$heap_132643)[32]' = 0
((char*)&$heap_132643)[40]' = 0
bytes_after(&$heap_132644)' = 32
$heap_132644' is allocated by malloc
bytes_before(&$heap_132644)' = 0
((char*)&$heap_132644)[16]' = 0
((char*)&$heap_132644)[20]' = 0
((char*)&$heap_132644)[24]' = 0
$heap_132645' = &$heap_132645
bytes_after(&$heap_132645)' = 184
$heap_132645' is allocated by malloc
bytes_before(&$heap_132645)' = 0
((char*)&$heap_132645)[176]' = 0
((char*)&$heap_132645)[32]' = 0
((char*)&$heap_132645)[40]' = 0
((char*)&$heap_132645)[8]' = &$heap_132645
$heap_132646' = 112
bytes_after(&$heap_132646)' = 6
$heap_132646' is allocated by malloc
bytes_before(&$heap_132646)' = 0
strlen(&$heap_132646)' = 5
$heap_132647' = *myarchname
bytes_after(&$heap_132647)' = strlen(myarchname) + 1
$heap_132647' is allocated by malloc
bytes_before(&$heap_132647)' = 0
strlen(&$heap_132647)' = strlen(myarchname)
bytes_after(&$heap_132648)' = strlen(((char*)&$unknown_867382)[192]) + 1
$heap_132648' is allocated by malloc
$heap_132648' is allocated
bytes_before(&$heap_132648)' = 0
strlen(&$heap_132648)' = strlen(((char*)&$unknown_867382)[192])
$heap_132649' = $input_60
bytes_after(&$heap_132649)' = $input_12 + 1
$heap_132649' is allocated by malloc
$heap_132649' is a non-heap object
bytes_before(&$heap_132649)' = 0
strlen(&$heap_132649)' = $input_12
$heap_132650' = &$unknown_867385
bytes_after(&$heap_132650)' = $input_12 + 1
$heap_132650' is allocated by malloc
$heap_132650' is allocated
bytes_before(&$heap_132650)' = 0
hn' = $param_1
hosts' = &$heap_132632
hp' = ((char*)&$unknown_867381)[8]
hp2' = &$unknown_867382
nel' = 2
p' = 0
s' = &$heap_132649
s' = 0




Change Warning 2681.2730 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: