Text  |   XML   |   Visible Warnings:

Pvm : Pvm analysis 1 : Null Pointer Dereference  at hoster.c:371

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2506.2536
Procedure: hoster
Trace: View
Modified: Wed Sep 2 12:39:56 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/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");
 368                 for (i = 0; i < num; i++) {
true369                         hp = TALLOC(1, struct hst, "hst");
 370                         hostlist[i] = hp;   /* Null Pointer Dereference (ID: 2507.2537) */
hp <= 4095371                         hp->h_flag = 0;     /* Null Pointer Dereference */
 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,"")) {
 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,"")) {
 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->, '@')) {
 399                                 hp->h_name = STRALLOC(p + 1);
 400                                 *p = 0;
 401                                 p = STRALLOC(hp->);
 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;
Preconditions
&$unknown_264366 >= 2
&$unknown_264371 = 0
Postconditions
bytes_after(&$heap_5819)' = 8 * &$unknown_264366
$heap_5819' is allocated by malloc
$heap_5819' is allocated
bytes_before(&$heap_5819)' = 0
hostlist' = &$heap_5819
hp' = &$unknown_264371
mp' = $param_1
num' = &$unknown_264366




Change Warning 2506.2536 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: