Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Redundant Condition  at pmsg.c:2825

Categories: LANG.STRUCT.RC CWE:570 CWE:571
Warning ID: 166.28788
Procedure: pmsg_unpack
Trace: view
Modified: Thu Nov 26 11:27: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
   /kat0/fletcher/SATE/2010/pvm3/src/pmsg.c
   Enter pmsg_unpack
 2782 pmsg_unpack(mp, mp2) 
 2783         struct pmsg *mp;                /* message to unpack from */ 
 2784         struct pmsg *mp2;               /* blank message to write on */ 
 2785 {
 2786         struct frag *fp;
 2787         int cc;
 2788         int mlen;
 2789         int frl;
 2790  
 2791         if (cc = (mp->m_codef->dec_int)
 2792                         (mp, (void*)&mlen, 1, 1, sizeof(int)))
 2793                 return cc;
 2794         if (cc = (mp->m_codef->dec_int)
 2795                         (mp, (void*)&mp2->m_ctx, 1, 1, sizeof(int)))
 2796                 return cc;
 2797         if (cc = (mp->m_codef->dec_int)
 2798                         (mp, (void*)&mp2->m_tag, 1, 1, sizeof(int)))
 2799                 return cc;
 2800         if (cc = (mp->m_codef->dec_int)
 2801                         (mp, (void*)&mp2->m_wid, 1, 1, sizeof(int)))
 2802                 return cc;
 2803         if (cc = (mp->m_codef->dec_int)
 2804                         (mp, (void*)&mp2->m_enc, 1, 1, sizeof(int)))
 2805                 return cc;
 2806         if (cc = (mp->m_codef->dec_int)
 2807                         (mp, (void*)&mp2->m_crc, 1, 1, sizeof(int)))
 2808                 return cc;
 2809         if (cc = (mp->m_codef->dec_int)
 2810                         (mp, (void*)&mp2->m_src, 1, 1, sizeof(int)))
 2811                 return cc;
 2812         if (cc = (mp->m_codef->dec_int)
 2813                         (mp, (void*)&mp2->m_dst, 1, 1, sizeof(int)))
 2814                 return cc;
 2815  
 2816         mp2->m_len = 0;   /* Null Pointer Dereference (ID: 180.28805) */
 2817  
 2818         if (mlen < 0)
 2819                 cc = PvmBadMsg;
 2820         else {
 2821                 while (mlen > 0) {
 2822                         if (cc = (mp->m_codef->dec_int)
 2823                                         (mp, (void*)&frl, 1, 1, sizeof(int)))
 2824                                 break;
Always True: fp != 02825                         if (!(fp = fr_new(frl + MAXHDR))) {     /* Redundant Condition */
 2826                                 cc = PvmNoMem;   /* Unreachable Computation (ID: 167.28789) */
 2827                                 break;
 2828                         }
 2829                         fp->fr_dat += MAXHDR;
 2830                         fp->fr_len = frl;
 2831                         if (cc = (mp->m_codef->dec_byte)
 2832                                         (mp, (void*)fp->fr_dat, frl, 1, 1))
 2833                                 break;
 2834                         LISTPUTBEFORE(mp2->m_frag, fp, fr_link, fr_rlink);
 2835                         mp2->m_len += frl;
 2836                         mlen -= frl;
 2837                 }
 2838                 pmsg_setenc(mp2, mp2->m_enc);
 2839         }
 2840         return cc;
 2841 } 




Change Warning 166.28788 : Redundant Condition

Priority:
State:
Finding:
Owner:
Note: