Text  |   XML   |   Visible Warnings:

Pvm : Pvm analysis 1 : Null Pointer Dereference  at ddpro.c:2565

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2574.2606
Procedure: dm_delhost
Trace: View
Modified: Wed Sep 2 12:41:31 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/ddpro.c
   Enter dm_delhost
 2529 dm_delhost(hp, mp) 
 2530         struct hostd *hp;
 2531         struct pmsg *mp;
 2532 {
 2533         int count;
 2534         char *buf;
 2535         struct pmsg *mp2;               /* DELHOSTACK message */ 
 2536         struct pmsg *mp3;               /* HTDEL message */ 
 2537         struct htab *ht_del;    /* hosts to delete */ 
 2538         struct htab *ht_save;   /* remaining hosts */ 
 2539         int hh;
 2540  
 2541 /* XXX danger, this doesn't check if already doing a host add/delete */ 
 2542  
 2543         /* sanity check count */ 
 2544  
 2545         if (upkint(mp, &count)) {
 2546                 pvmlogerror("dm_delhost() bad msg format\n");
 2547                 return 0;
 2548         }
 2549         if (count < 1 || count > (tidhmask >> (ffs(tidhmask) - 1))) {
 2550                 pvmlogerror("dm_delhost() bad count\n");
 2551                 return 0;
 2552         }
 2553  
 2554         /*
 2555         * read host names from message, generate delete and save sets 
 2556         * and a DELHOSTACK reply message with result code for each host.
 2557         * set SHUTDOWN flag for each host in delete set.
 2558         */ 
 2559  
 2560         ht_del = ht_new(1);   /* Leak (ID: 2568.2600) */
 2561         ht_save = ht_new(1);   /* Leak (ID: 2569.2601) */
 2562         ht_merge(ht_save, hosts);
 2563  
true2564         mp2 = mesg_new(0);
mp2 <= 40952565         mp2->m_tag = DM_DELHOSTACK;     /* Null Pointer Dereference */
Preconditions
&$unknown_633822 >= 1
hosts->ht_last = 1
((char*)&$heap_38079)[8] >= 0
numpmsgs = 0
Postconditions
count' = &$unknown_633822
freepmsgs.m_link' = &freepmsgs.m_link
freepmsgs.m_rlink' = &freepmsgs.m_link
$heap_38077' = 0
bytes_after(&$heap_38077)' = 40
$heap_38077' is allocated by malloc
$heap_38077' is allocated
bytes_before(&$heap_38077)' = 0
strlen(&$heap_38077)' = 0
((char*)&$heap_38077)[32]' = &$heap_38078
((char*)&$heap_38077)[4]' = 1
$heap_38078' = 0
bytes_after(&$heap_38078)' = 16
$heap_38078' is allocated by malloc
$heap_38078' is allocated
bytes_before(&$heap_38078)' = 0
strlen(&$heap_38078)' = 0
$heap_38079' = 0
bytes_after(&$heap_38079)' = 40
$heap_38079' is allocated by malloc
$heap_38079' is allocated
bytes_before(&$heap_38079)' = 0
strlen(&$heap_38079)' = 0
hp' = $param_1
ht_del' = &$heap_38077
ht_save' = &$heap_38079
mp' = $param_2
mp2' = 0




Change Warning 2574.2606 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: