Text  |   XML   |   Visible Warnings:

Pvm : Pvm analysis 1 : Null Pointer Dereference  at lpvm.c:1608

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2758.2813
Procedure: mxinput
Trace: View
Modified: Wed Sep 2 12:45:04 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/lpvm.c
   Enter mxinput
 1545 mxinput(pcbp, nfr) 
 1546         struct ttpcb *pcbp;
 1547         int *nfr;                               /* number of frags read */ 
 1548 {
 1549         int gotem = 0;                  /* num msgs added to pvmrxlist */ 
 1550         struct frag *fp;                /* shadows pcbp->tt_rxf */ 
 1551         struct frag *fp2;
 1552         int n;                                  /* bytes received */ 
 1553         int m;                                  /* length of fragment */ 
 1554         struct pmsg *rxup;              /* message containing this frag */ 
 1555         struct pmsg *hdfrgpile;
 1556         char *cp;                               /* gp */ 
 1557         int src;
 1558         int dst;
 1559         int ff;
 1560         static int fairprobe = 0;
 1561  
 1562         *nfr = 0;
 1563  
 1564  
 1565 #if defined(IMA_MPP) 
 1566  
 1567         /* Messages from Tasks and  Messages from the daemon  are probed 
 1568          * fairprobe makes sure that neither interface gets starved.  
 1569          * fairprobe is toggled when an EOM is found   
 1570         */ 
 1571  
 1572         switch (fairprobe)
   ...
 1584                         if ((fp = pvm_readfrompvmd()) == (struct frag *) NULL)  
 1585                                 fp = pvm_readfrompeer();
 1586                         break;
 1587  
 1588         }
 1589  
 1590         if (!fp)  
 1591                 return gotem;   /* didn't read anything */ 
 1592  
 1593 #else 
 1594         if (!pcbp->tt_rxf)
true1595                 if (!(pcbp->tt_rxf = fr_new(pvmfrgsiz)))   /* Redundant Condition (ID: 2753.2808) */
 1596                         return PvmNoMem;   /* Unreachable Computation (ID: 2754.2809) */
$unknown_8973729 <= 40951597         fp = pcbp->tt_rxf;
 1598  
 1599         /* read fragment header separately from body */ 
 1600  
$unknown_8973735 <= 40951601         n = (fp->fr_len < TDFRAGHDR) ? 0 : pvmget32(fp->fr_dat + 8);
$unknown_8973755 <= 40951602         n += TDFRAGHDR - fp->fr_len;
$unknown_8973759 <= 40951603         if (pvmdebmask & PDMPACKET) {
$unknown_8973779 <= 40951604                 pvmlogprintf("mxinput() pcb t%x fr_len=%d fr_dat=+%d n=%d\n",
$unknown_8973763 <= 40951605                                 pcbp->tt_tid, fp->fr_len, fp->fr_dat - fp->fr_buf, n);
 1606         }
 1607 #ifndef WIN32 
 1608         n = read(pcbp->tt_fd, fp->fr_dat + fp->fr_len, n);     /* Null Pointer Dereference */
Preconditions
((char*)$param_1)[24] >= 0
((char*)$param_1)[72] = 0
numfrags != 0
pvmfrgsiz = 0
$input_12 <= 16
$input_12 >= 1
$input_12 >= $input_65204 + 1
$input_12 >= $input_65212 + 1
$input_65204 <= 15
$input_65204 >= 0
$input_65212 <= 15
$input_65212 >= 0
Postconditions
freefrags.fr_link->fr_link->fr_rlink' = freefrags.fr_link->fr_rlink
freefrags.fr_link->fr_buf' = 0
freefrags.fr_link->fr_dat' = 0
freefrags.fr_link->fr_max' = 0
freefrags.fr_link->fr_len' = 0
freefrags.fr_link->fr_u.ref' = 1
freefrags.fr_link->fr_u.dab' = 1
freefrags.fr_link->fr_u.spr' = 0
freefrags.fr_link->fr_rip' = 0
freefrags.fr_link->fr_rlink' = freefrags.fr_link
freefrags.fr_link->fr_rlink->fr_link' = freefrags.fr_link->fr_link
freefrags.fr_link->fr_link' = freefrags.fr_link
*stderr' is allocated by fopen
bytes_before(stderr)' = 0
fp' = freefrags.fr_link
gotem' = 0
n' = 16
newline' = 1
nfr' = $param_2
numfrags' = numfrags - 1
pcbp' = $param_1




Change Warning 2758.2813 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: