Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Null Pointer Dereference  at ddpro.c:1794

Categories: LANG.MEM.NPD CWE:476
Warning ID: 132.28753
Procedure: dm_htupd
Trace: view
Modified: Thu Nov 26 11:27:43 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/ddpro.c
   Enter dm_htupd
 1744 dm_htupd(hp, mp) 
 1745         struct hostd *hp;
 1746         struct pmsg *mp;
 1747 {
 1748         int count;                      /* number of hosts in message */ 
 1749         int hh;
 1750         char buf[16];           /* for converting sockaddr */ 
 1751         struct pmsg *mp2;
 1752  
 1753         /* unpack new host table params */ 
 1754  
 1755         newhosts = ht_new(1);
 1756         newhosts->ht_local = hosts->ht_local;
 1757         upkint(mp, &newhosts->ht_serial);
 1758         upkint(mp, &newhosts->ht_master);
 1759         upkint(mp, &newhosts->ht_cons);
 1760  
 1761         /* add current hosts to the table */ 
 1762  
 1763         ht_merge(newhosts, hosts);
 1764  
 1765         /* unpack new hosts and add to table */ 
 1766  
 1767         /* XXX if we find a host already in table we should kill it with 
 1768            XXX hostfail and put the new one in its place */ 
 1769  
 1770         upkint(mp, &count);
 1771         while (count-- > 0) {
 1772                 upkint(mp, &hh);
 1773                 hp = hd_new(hh);
 1774                 upkstralloc(mp, &hp->hd_name);
 1775                 upkstralloc(mp, &hp->hd_arch);
 1776                 upkstr(mp, buf, sizeof(buf));
 1777                 hex_inadport(buf, &hp->hd_sad);
 1778                 upkint(mp, &hp->hd_mtu);
 1779                 upkint(mp, &hp->hd_speed);
 1780                 upkint(mp, &hp->hd_dsig);
 1781                 ht_insert(newhosts, hp);
 1782                 hd_unref(hp);
 1783         }
 1784  
 1785         if (pvmdebmask & PDMHOST) {
 1786                 pvmlogerror("dm_htupd() new host table:\n");
 1787                 ht_dump(newhosts);
 1788         }
 1789         runstate = PVMDHTUPD;
 1790  
 1791         /* reply to sender that we have new host table */ 
 1792  
true1793         mp2 = mesg_new(0);
mp2 <= 40951794         mp2->m_dst = mp->m_src;     /* Null Pointer Dereference */
Preconditions
hosts->ht_last = 1
numpmsgs = 0
Postconditions
count' = -1
errno' != 0
freepmsgs.m_link' = &freepmsgs.m_link
freepmsgs.m_rlink' = &freepmsgs.m_link
bytes_after(&$heap_64786)' = 32
$heap_64786' is allocated by malloc
bytes_before(&$heap_64786)' = 0
((char*)&$heap_64786)[20]' = hosts->ht_local
mp2' = 0
newhosts' = &$heap_64786
runstate' = 2




Change Warning 132.28753 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: