Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Null Pointer Dereference  at hoster.c:427

Categories: LANG.MEM.NPD CWE:476
Warning ID: 101.28698
Procedure: hoster
Trace: view
Modified: Thu Nov 26 11:27: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/hoster.c
   Enter hoster
 348 hoster(mp) 
 349         struct pmsg *mp;
 350 {
 351         struct pmsg *mp2;
 352         int num;
 353         int i;
 354         struct hst **hostlist;
 355         struct hst *hp;
 356         char *p;
 357  
 358         /*
 359         * unpack the startup message 
 360         */ 
 361  
 362         upkint(mp, &num);
 363         if (pvmdebmask & PDMSTARTUP) {
 364                 pvmlogprintf("hoster() %d to start\n", num);
 365         }
 366         if (num > 0) {
 367                 hostlist = TALLOC(num, struct hst *, "hsts");   /* Integer Overflow of Allocation Size (ID: 104.28706) */
 368                 for (i = 0; i < num; i++) {
 369                         hp = TALLOC(1, struct hst, "hst");
 370                         hostlist[i] = hp;   /* Null Pointer Dereference (ID: 103.28705) */
 371                         hp->h_flag = 0;   /* Null Pointer Dereference (ID: 102.28704) */
 372                         hp->h_result = 0;
 373                         if (upkint(mp, &hp->h_tid) 
 374                         || upkstralloc(mp, &hp->h_sopts) 
 375                         || upkstralloc(mp, &hp->) 
 376                         || upkstralloc(mp, &hp->h_cmd) 
 377                         || upkstralloc(mp, &hp->h_wincmd) 
 378                         || upkstralloc(mp, &hp->h_vmid)) {
 379                                 pvmlogerror("hoster() bad message format\n");
 380                                 pvmbailout(0);
 381                         }
 382                         /* Check for (possible) alternate WIN32 pvmd cmd */ 
 383                         if (!strcmp(hp->h_wincmd,"")) {   /* Null Pointer Dereference (ID: 22042.28703) */
 384                                 PVM_FREE(hp->h_wincmd);
 385                                 hp->h_wincmd = 0;
 386                         }
 387                         /* Check for (optional) virtual machine ID */ 
 388                         if (!strcmp(hp->h_vmid,"")) {   /* Null Pointer Dereference (ID: 22041.28702) */
 389                                 PVM_FREE(hp->h_vmid);
 390                                 hp->h_vmid = 0;
 391                         }
 392                         if (pvmdebmask & PDMSTARTUP) {
 393                                 pvmlogprintf("%d. t%x %s so=\"%s\"\n", i,
 394                                                 hp->h_tid,
 395                                                 hp->,
 396                                                 hp->h_sopts);
 397                         }
 398                         if (p = CINDEX(hp->, '@')) {   /* Null Pointer Dereference (ID: 22040.28701) */
 399                                 hp->h_name = STRALLOC(p + 1);   /* Null Pointer Dereference (ID: 22039.28700) */
 400                                 *p = 0;
 401                                 p = STRALLOC(hp->);   /* Null Pointer Dereference (ID: 22038.28699) */
 402                                 PVM_FREE(hp->);
 403                                 hp-> = p;
 404  
 405                         } else {
 406                                 hp->h_name = hp->;
 407                                 hp-> = 0;
 408                         }
 409                         if (!strcmp(hp->h_sopts, "pw"))
 410                                 hp->h_flag |= HST_PASSWORD;
 411                         if (!strcmp(hp->h_sopts, "ms"))
 412                                 hp->h_flag |= HST_MANUAL;
 413                 }
 414         }
 415  
 416         /*
 417         * do it 
 418         */ 
 419  
 420         pl_startup(num, hostlist);   /* Uninitialized Variable (ID: 105.28707) */
 421  
 422         /*
 423         * send results back to pvmd 
 424         */ 
 425  
true426         mp2 = mesg_new(0);
mp2 <= 4095427         mp2->m_dst = mp->m_src;     /* Null Pointer Dereference */
Preconditions
&$unknown_265897 >= 1
&$unknown_265899 >= 1
&$unknown_265901 >= 1
&$unknown_265903 >= 1
&slots[0].s_link != &$unknown_265908 - 3312
strlen(&$unknown_265907) >= 1
$heap_9107 = 109
strlen(&$heap_9107) = 2
$heap_9108 != 64
$heap_9110 <= 0
numpmsgs = 0
Postconditions
$unknown_265907' = 0
strlen(&$unknown_265907)' = 0
((char*)&$unknown_265908)[544]' = 0
((char*)&$unknown_265908)[548]' = 0
errno' != 0
freepmsgs.m_link' = &freepmsgs.m_link
freepmsgs.m_rlink' = &freepmsgs.m_link
$heap_9105' = &$heap_9106
bytes_after(&$heap_9105)' = 4
$heap_9105' is allocated by malloc
$heap_9105' is allocated
bytes_before(&$heap_9105)' = 0
bytes_after(&$heap_9106)' = 36
$heap_9106' is allocated by malloc
bytes_before(&$heap_9106)' = 0
((char*)&$heap_9106)[16]' = 2
((char*)&$heap_9106)[20]' = &$heap_9109
((char*)&$heap_9106)[24]' = &$heap_9110
((char*)&$heap_9106)[28]' = 0
((char*)&$heap_9106)[32]' = 0
((char*)&$heap_9106)[4]' = &$heap_9112
((char*)&$heap_9106)[8]' = &$heap_9113
((char*)&$heap_9106)[12]' = &$heap_9107
bytes_after(&$heap_9107)' = &$unknown_265897
$heap_9107' is allocated by malloc
bytes_before(&$heap_9107)' = 0
bytes_after(&$heap_9108)' = &$unknown_265899
$heap_9108' is allocated by malloc
$heap_9108' is freed
bytes_before(&$heap_9108)' = 0
bytes_after(&$heap_9109)' = &$unknown_265901
$heap_9109' is allocated by malloc
bytes_before(&$heap_9109)' = 0
bytes_after(&$heap_9110)' = &$unknown_265903
$heap_9110' is allocated by malloc
bytes_before(&$heap_9110)' = 0
bytes_after(&$heap_9112)' = strlen(&$unknown_265907)
$heap_9112' is allocated by malloc
$heap_9112' is allocated
bytes_before(&$heap_9112)' = 0
strlen(&$heap_9112)' = strlen(&$unknown_265907) - 1
$heap_9113' = $heap_9108
bytes_after(&$heap_9113)' = strlen(&$heap_9108) + 1
$heap_9113' is allocated by malloc
$heap_9113' is allocated
bytes_before(&$heap_9113)' = 0
strlen(&$heap_9113)' = strlen(&$heap_9108)
hostlist' = &$heap_9105
hp' = &$heap_9106
i' = 1
mp2' = 0
num' = 1
p' = &$heap_9113
slfree' = &slots[0].s_link + 3312
slots[5].s_link' = &slots[0].s_link + 2760
slots[6].s_link' = &$unknown_265908




Change Warning 101.28698 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: