Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Uninitialized Variable  at trcfile.c:1264

Categories: LANG.MEM.UVAR CWE:457
Warning ID: 22159.29168
Procedure: trc_store_trace_event
Trace: view
Modified: Thu Nov 26 11:35:33 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/trcfile.c
   Enter trc_store_trace_event
true964 trc_store_trace_event( ID, TD, tid, omit ) 
 965 TRC_ID ID;
 966 TRC_TEVDESC TD;
 967 int tid;
 968 int omit;
 969 {
 970         TRC_DATADESC DD;
 971  
 972         TRC_TEVTASK TT;
 973  
 974         char    upk_byte[TRC_MAX_UNPACK_ARR_SIZE];
   ...
 989         int maxlen;
 990         int ignore;
 991         int tusec;
 992         int tsec;
 993         int len;
 994         int num;
 995         int i;
 996  
 997         /* Dump Descriptor (if necessary) */ 
 998  
 999         if ( !omit && TD->dump )
 1000                 trc_dump_tevdesc( ID, TD, tid );
 1001  
 1002         /* Set New Task Flag */ 
 1003  
 1004         TT = (TRC_TEVTASK) NULL;
 1005  
 1006         tsec = tusec = -1;
 1007  
 1008         newtask = TRC_FALSE;
 1009         endtask = TRC_FALSE;
 1010  
 1011         if ( !strcmp( TD->name, "newtask" ) 
 1012                 || !strcmp( TD->name, "spntask" ) )
 1013         {
 1014                 newtask = TRC_TRUE;
 1015         }
 1016  
 1017         else if ( !strcmp( TD->name, "endtask" ) )
 1018                 endtask = TRC_TRUE;
 1019  
 1020         ignore = TRC_FALSE;
 1021  
 1022         /* Store Event Header */ 
 1023  
 1024         if ( !omit )
 1025                 trc_store_event_header( ID, TD, tid );
 1026  
 1027         /* Store Remainder of Event */ 
 1028  
 1029         DD = TD->ddesc;
 1030  
 1031         while ( DD != NULL )
 1032         {
 1033                 if ( DD->array == TEV_DATA_ARRAY )
 1034                 {
 1035                         TRC_PVMCKERR( pvm_upkint( &num, 1, 1 ),
 1036                                 "Array Unpack", return( TRC_FALSE ) );
 1037  
 1038                         if ( num > TRC_MAX_UNPACK_ARR_SIZE   /* Uninitialized Variable (ID: 22163.29172) */
 1039                                 && DD->dt != TEV_DATA_STRING )
 1040                         {
 1041                                 if ( !omit )
 1042                                         printf( "Error: Unpack Size %d Too Large\n", num );
 1043  
   ...
 1063                                 }
 1064  
 1065                                 else 
 1066                                 {
 1067                                         fprintf( ID->trace_out, "[%d] { ", num );
 1068                                         /* matching } */ 
 1069                                 }
 1070                         }
 1071                 }
 1072  
 1073                 else 
 1074                         num = 1;
 1075  
 1076                 switch ( DD->dt ) 
 1077                 {
 1078                         case TEV_DATA_NULL: break;
 1079  
 1080                         case TEV_DATA_BYTE: 
 1081                         {
 1082                                 TRC_PVMCKERR( pvm_upkbyte( upk_byte, num, 1 ),
 1083                                         "Event BYTE Unpack", return( TRC_FALSE ) );
 1084  
 1085                                 if ( omit )
 1086                                         break;
   ...
 1170                                 {
 1171                                         fprintf( ID->trace_out, "%f", upk_float[i] );
 1172  
 1173                                         if ( i < num - 1 )
 1174                                                 fprintf( ID->trace_out, ", " );
 1175                                 }
 1176  
 1177                                 break;
 1178                         }
 1179  
 1180                         case TEV_DATA_INT: 
 1181                         {
 1182                                 TRC_PVMCKERR( pvm_upkint( upk_int, num, 1 ),
 1183                                         "Event INT Unpack", return( TRC_FALSE ) );
 1184  
 1185                                 if ( !omit )
 1186                                 {
 1187                                         for ( i=0 ; i < num ; i++ )
 1188                                         {
 1189                                                 fprintf( ID->trace_out, "%d", upk_int[i] );
 1190  
 1191                                                 if ( i < num - 1 )
 1192                                                         fprintf( ID->trace_out, ", " );
 1193                                         }
 1194                                 }
 1195  
 1196                                 if ( ( newtask || endtask )
 1197                                         && !strcmp( DD->did->name, "TID" ) )
 1198                                 {
 1199                                         if ( !omit && newtask )
 1200                                         {
 1201                                                 TT = trc_get_tevtask_tid( ID, upk_int[0] );
 1202  
 1203                                                 if ( TT == NULL )
 1204                                                 {
 1205                                                         if ( !ignore )
 1206                                                         {
 1207                                                                 sprintf( msg,
   ...
 1250                                                 }
 1251  
 1252                                                 else if ( !omit )
 1253                                                 {
 1254                                 printf( "\nWarning: ENDTASK Unknown Task TID=0x%x.\n\n",
 1255                                                         upk_int[0] );
 1256                                                 }
 1257                                         }
 1258                                 }
 1259  
 1260                                 else if ( !strcmp( DD->did->name, "TS" ) )
 1261                                         tsec = upk_int[0];   /* Uninitialized Variable (ID: 22161.29170) */
 1262                                  
 1263                                 else if ( !strcmp( DD->did->name, "TU" ) )
upk_int is uninitialized1264                                         tusec = upk_int[0];     /* Uninitialized Variable */
Preconditions
omit != 0
TD->ddesc->dt = 6
TD->ddesc->array != 128
*TD->ddesc->did->name = 84
strlen(TD->ddesc->did->name) = 2
*TD->name = 110
strlen(*TD) = 7
myfmt != -1
pvmmytid = -1
pvmrbuf = 0
pvmtoplvl != 0
Postconditions
DD' = TD->ddesc
TRC_TMP_CC' = 0
TT' = 0
endtask' = 0
ignore' = 0
newtask' = 1
num' = 1
pvmtrccodef' = &pvmtrccodef_nop.enc_byte
pvmtrcsavekind' = 63
tsec' = -1
tusec' = -1




Change Warning 22159.29168 : Uninitialized Variable

Priority:
State:
Finding:
Owner:
Note: