Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Unreachable Data Flow  at pmsg.c:613

Categories: LANG.STRUCT.UC CWE:561
Warning ID: 206.28838
Procedure: bytepk
Trace: view
Modified: Thu Nov 26 11:28:12 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     
LineSource
  /kat0/fletcher/SATE/2010/pvm3/src/pmsg.c
  Enter bytepk
575 bytepk(mp, cp, num, siz, lnc) 
576         struct pmsg *mp;
577         char *cp;                       /* base of data */ 
578         int num;                        /* num of chunks */ 
579         int siz;                        /* size of chunk */ 
580         int lnc;                        /* lead to next chunk */ 
581 {
582         struct frag *fp;                        /* working frag */ 
583         int togo;                                       /* bytes left in chunk */ 
584         int r;                                          /* bytes (space) left in frag */ 
585  
586         if (siz == lnc) {               /* if contiguous, treat as single chunk */ 
587                 lnc = (siz *= num);
588                 num = 1;
589         }
590         lnc -= siz;             /* now bytes between chunks */ 
591  
592         while (num-- > 0) {             /* copy chunks until done */ 
593  
594                 for (togo = siz; togo > 0; ) {
595                         fp = mp->m_frag->fr_rlink;
596                         r = fp->fr_max - (fp->fr_dat - fp->fr_buf) - fp->fr_len;
597  
598                         if (togo <= r) {        /* space in frag for entire chunk */ 
599                                 BCOPY(cp, fp->fr_dat + fp->fr_len, togo);
600                                 fp->fr_len += togo;
601                                 cp += togo;
602                                 togo = 0;
603  
604                         } else {
605                                 if (r > 0) {    /* space for part of chunk */ 
606                                         BCOPY(cp, fp->fr_dat + fp->fr_len, r);
607                                         fp->fr_len += r;
608                                         togo -= r;
609                                         cp += r;
610  
611                                 } else {                /* no space, add new frag */ 
612                                         if (r = pmsg_extend(mp))   /* Redundant Condition (ID: 205.28837) */
613                                                 return r;     /* Unreachable Data Flow */
614                                 }
615                         }
616                 }
617                 cp += lnc;
618         }
619         return 0;
620 } 




Change Warning 206.28838 : Unreachable Data Flow

Priority:
State:
Finding:
Owner:
Note: