Text  |   XML   |   Visible Warnings:

Pvm : Pvm analysis 1 : Null Pointer Dereference  at pvmd.c:3607

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2491.2520
Procedure: loclstout
Trace: View
Modified: Wed Sep 2 12:39:51 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/pvmd.c
   Enter loclstout
 3557 loclstout(tp) 
 3558         struct task *tp;
 3559 {
 3560         int n;
 3561         struct pmsg *mp;
 3562  
 3563         static char buf[4000];
 3564  
 3565 #ifndef WIN32 
 3566         n = read(tp->t_out, buf, sizeof(buf) - 1);
 3567 #else 
 3568         n = win32_read_socket(tp->t_out,buf, sizeof(buf) -1); 
 3569 #endif 
 3570  
 3571         if (n < 1) {
 3572                 if (n == 0 || (errno != EINTR 
 3573 #ifndef WIN32 
 3574                                 && errno != EWOULDBLOCK 
 3575 #endif 
 3576                         )) {
 3577                         wrk_fds_delete(tp->t_out, 1);
 3578 #ifndef WIN32 
 3579                         (void)close(tp->t_out);
 3580 #else 
 3581                         (void)_close(tp->t_out); 
   ...
 3586                                 mp->m_dst = tp->t_outtid;   /* Null Pointer Dereference (ID: 2492.2522) */
 3587                                 mp->m_ctx = tp->t_outctx;
 3588                                 mp->m_tag = tp->t_outtag;
 3589                                 pkint(mp, tp->t_tid);
 3590                                 pkint(mp, TO_EOF);
 3591                                 sendmessage(mp);
 3592                                 tp->t_outtid = 0;
 3593                         }
 3594                 }
 3595  
 3596         } else {
true3597                 mp = mesg_new(0);
 3598                 pkint(mp, tp->t_tid);
 3599                 pkint(mp, n);
 3600                 pkbyte(mp, buf, n);
 3601                 if (tp->t_outtid > 0) {
 3602                         mp->m_dst = tp->t_outtid;   /* Null Pointer Dereference (ID: 2492.2521) */
 3603                         mp->m_ctx = tp->t_outctx;
 3604                         mp->m_tag = tp->t_outtag;
 3605  
 3606                 } else {
mp <= 40953607                         mp->m_tag = DM_TASKOUT;     /* Null Pointer Dereference */
Preconditions
((char*)$param_1)[144] <= 0
((char*)$param_1)[104] >= 0
numpmsgs = 0
$input_12 <= 3999
$input_12 >= 1
Postconditions
freepmsgs.m_link' = &freepmsgs.m_link
freepmsgs.m_rlink' = &freepmsgs.m_link
mp' = 0
n' = $input_12
tp' = $param_1




Change Warning 2491.2520 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: