Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Uninitialized Variable  at lpvm.c:3514

Categories: LANG.MEM.UVAR CWE:457
Warning ID: 411.29128
Procedure: pvm_getfds
Trace: view
Modified: Thu Nov 26 11:34:41 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/lpvm.c
   Enter pvm_getfds
true3471 pvm_getfds(fds)         /* XXX this function kinda sucks */ 
 3472         int **fds;                      /* fd list return */ 
 3473 {
 3474         static int *fdlist = 0;
 3475         static int fdlen = 0;
 3476         int cc;
 3477         int nfds;
 3478         struct ttpcb *pcbp;
 3479         TEV_DECLS 
 3480  
 3481         if (TEV_EXCLUSIVE) {
 3482                 if (TEV_DO_TRACE(TEV_GETFDS,TEV_EVENT_ENTRY))
 3483                         TEV_FIN;
 3484         }
 3485  
 3486         if (!(cc = BEATASK)) {
 3487                 nfds = 1;
 3488                 for (pcbp = ttlist->tt_link; pcbp != ttlist; pcbp = pcbp->tt_link)
 3489                         if (pcbp->tt_state == TTOPEN || pcbp->tt_state == TTGRNWAIT)
 3490                                 nfds++;
 3491  
 3492                 if (fdlen < nfds) {
 3493                         fdlen = (nfds * 3) / 2 + 1;
 3494                         if (fdlist)
 3495                                 fdlist = TREALLOC(fdlist, fdlen, int);
 3496                         else 
   ...
 3499  
 3500                 fdlist[0] = topvmd->tt_fd;   /* Null Pointer Dereference (ID: 410.29129) */
 3501                 nfds = 1;
 3502                 for (pcbp = ttlist->tt_link; pcbp != ttlist; pcbp = pcbp->tt_link)
 3503                         if (pcbp->tt_state == TTOPEN || pcbp->tt_state == TTGRNWAIT)
 3504                                 fdlist[nfds++] = pcbp->tt_fd;
 3505                 *fds = fdlist;
 3506                 cc = nfds;
 3507         }
 3508  
 3509         if (TEV_AMEXCL) {
 3510                 if (TEV_DO_TRACE(TEV_GETFDS,TEV_EVENT_EXIT)) {
 3511                         TEV_PACK_INT( TEV_DID_CC, TEV_DATA_SCALAR, &cc, 1, 1 );
 3512                         if (cc > 0) {
 3513                                 TEV_PACK_INT( TEV_DID_FDS, TEV_DATA_ARRAY,
nfds is uninitialized3514                                         (int *)fdlist, nfds, 1 );     /* Uninitialized Variable */
Preconditions
&$unknown_10963516 != 0
&$unknown_10963519 >= 1
pvmmytid = -1
pvmtoplvl != 0
Postconditions
cc' = &$unknown_10963519
pvmampushed' = 0
pvmamtraced' = pvmtoplvl
pvmtoplvl' = 0
pvmtrccodef' = &$unknown_10963518
pvmtrcsavekind' = 9




Change Warning 411.29128 : Uninitialized Variable

Priority:
State:
Finding:
Owner:
Note: