Text  |   XML   |   Visible Warnings:

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

Categories: LANG.MEM.UVAR CWE:457
Warning ID: 476.29244
Similar Warnings: 476.29241
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                                         }
 901  
 902                                         switch ( *fmt ) 
 903                                         {
 904                                                 case 'd': 
 905                                                 {
 906                                                         fscanf( ID->trace_in, ", %d", &ival );
 907                  
 908                                                         sprintf( tmp, " %d", ival );   /* Uninitialized Variable (ID: 476.29241) */
 909                  
 910                                                         trc_append_str( result, tmp, 4096 );
 911          
 912                                                         break;
 913                                                 }
 914                  
 915                                                 /* decimal result code */ 
 916                                                 case 'R': 
 917                                                 {
 918                                                         fscanf( ID->trace_in, ", %d", &ival );   /* Ignored Return Value (ID: 572.29371) */
 919                  
ival is uninitialized920                                                         sprintf( tmp, " %d", ival );     /* Uninitialized Variable */
Preconditions
$unknown_12091740 = 37
strlen(&$unknown_12091740) != 0
strlen(&$unknown_12091740) != 1
((char*)&$unknown_12091740)[1] = 82
Postconditions
errno' != 0
fmt' = &$unknown_12091740 + 1
keep' = 0
nkeep' = 0
vecflag' = 0
veclen' = 0




Change Warning 476.29244 : Uninitialized Variable

Because they are very similar, this warning shares annotations with warning 476.29241.
CodeSonar has selected warning 476.29241 to represent this group of similar warnings. In order to edit this group, you must edit warning 476.29241.