Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Uninitialized Variable  at trccompat.c:1013

Categories: LANG.MEM.UVAR CWE:457
Warning ID: 475.29245
Procedure: trc_old_pvm_event_string
Trace: view
Modified: Thu Nov 26 11:36:25 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/tracer/trccompat.c
   Enter trc_old_pvm_event_string
 817 char * 
true818 trc_old_pvm_event_string( ID, eid ) 
 819 TRC_ID ID;
 820 int eid;
 821 {
 822         char result[4096];
 823         char tmp[2048];
 824         char buf[1024];
 825  
 826         char *fmt;
 827         char *str;
 828  
 829         int keeplist[10];
 830  
 831         int vecflag;
 832         int veclen;
 833         int index;
 834         int nkeep;
 835         int keep;
 836         int ival;
 837         int sep;
 838  
 839         fmt = trc_old_tev_formats[ eid ].fmt;
 840  
 841         if ( fmt != NULL )
 842         {
 843                 nkeep = 0;
 844  
 845                 if ( *fmt != '=' )
 846                         sprintf( result, "%s", trc_old_tev_formats[ eid ].name );
 847  
 848                 else 
 849                         sprintf( result, "%s() ", trc_old_tev_formats[ eid ].name );
 850          
 851                 while ( *fmt )
 852                 {
 853                         if ( *fmt == '%' )
 854                         {
 855                                 fmt++;
 856  
 857                                 if ( *fmt == '*' )
 858                                 {
 859                                         keep = TRC_TRUE;
 860  
 861                                         fmt++;
 862                                 }
 863  
 864                                 else 
 865                                         keep = TRC_FALSE;
 866  
 867                                 if ( *fmt == '$' )
 868                                 {
 869                                         fmt++;
 870  
 871                                         index = *fmt - '0';
 872  
 873                                         fmt++;
 874  
 875                                         veclen = ( index >= 0 && index < nkeep ) 
 876                                                 ? keeplist[index] : 0;
 877  
 878                                         vecflag = TRC_TRUE;
 879  
 880                                         sep = TRC_FALSE;
 881                                 }
 882  
 883                                 else 
 884                                 {
 885                                         veclen = 1;
 886  
 887                                         vecflag = TRC_FALSE;
 888                                 }
 889  
 890                                 while ( veclen > 0 )
 891                                 {
 892                                         veclen--;
 893  
 894                                         if ( vecflag )
 895                                         {
 896                                                 if ( sep )
 897                                                         trc_append_str( result, " ", 4096 );
 898  
 899                                                 sep = TRC_TRUE;
 900                                         }
   ...
 998                                                 {
 999                                                         sprintf( tmp, "%%%c", *fmt );
 1000                  
 1001                                                         trc_append_str( result, tmp, 4096 );
 1002          
 1003                                                         break;
 1004                                                 }
 1005                                         }
 1006                                 }
 1007          
 1008                                 if ( *fmt )
 1009                                         fmt++;
 1010                                  
 1011                                 if ( keep )
 1012                                 {
ival is uninitialized1013                                         keeplist[nkeep] = ival < 0 ? 0 : ival;     /* Uninitialized Variable */
Preconditions
$unknown_12091776 = 37
strlen(&$unknown_12091776) != 0
strlen(&$unknown_12091776) != 2
strlen(&$unknown_12091776) != 4
strlen(&$unknown_12091776) != 1
((char*)&$unknown_12091776)[2] = 36
((char*)&$unknown_12091776)[3] <= 47
((char*)&$unknown_12091776)[4] != 0
((char*)&$unknown_12091776)[1] = 42
Postconditions
fmt' = &$unknown_12091776 + 5
index' = ((char*)&$unknown_12091776)[3] - 48
keep' = 1
nkeep' = 0
sep' = 0
vecflag' = 1
veclen' = 0




Change Warning 475.29245 : Uninitialized Variable

Priority:
State:
Finding:
Owner:
Note: