Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Uninitialized Variable  at pvmgs_func.c:275

Categories: LANG.MEM.UVAR CWE:457
Warning ID: 22190.29359
Procedure: gs_hash_name
Trace: view
Modified: Thu Nov 26 11:39:17 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/pvmgs/pvmgs_core.c
   Enter gs_handle
 245 gs_handle( hash_list, ngroups, gstid ) 
 246 GROUP_LIST_PTR hash_list;
 247 int *ngroups, *gstid;
 248 {
 249         int len, msgtag, tid, gid, cc, ftid, inst, i, size, ntids, listsize;
 250         int cnt, hosttid, nhosts, nmem_onhost, pcoord;
 251         int *nmem_onhostv = (int *) NULL, *pcoordv = (int *) NULL;  
 252         int mxupklen = 0;
 253         GROUP_STRUCT_PTR group;
 254         char *groupname = (char *) NULL;
 255         int *tidlist = (int *) NULL;
 256         int maxntids = 0, info;
 257         int gstate;
 258  
 259         while ( 1 )  
 260         {
 261                 if ( (cc = pvm_recv( -1, -1 )) < 0 )  /* receive a request */ 
 262                 {
 263                         pvm_perror( "gs_handle(recv)" );
 264                         return( cc );
 265                 }
 266                 /* get: length of message, message tag, and sending tid */ 
 267                 if ( (cc = pvm_bufinfo( pvm_getrbuf(), &len, &msgtag, &tid )) 
 268                                 < 0 )  
 269                 {
 270                         pvm_perror("gs_handle(bufinfo)");
 271                         return( cc );
 272                 }
 273  
 274                 /* Most group functions require unpacking a group name, so */ 
 275                 /* Make sure variable groupname is always long enough */ 
true276                 REALLOCSTRING( len, mxupklen , groupname, "gs_handle(entry)" );   /* Leak (ID: 559.29354) */  /* Ignored Return Value (ID: 571.29375) */
 277  
 278                 switch( msgtag ) 
 279                 {
 280                         case (DIE):             /* leave a suicide note */ 
 281                                 gs_pstate( "pvmgs", hash_list, ngroups );
 282                                 return( PvmOk );
 283  
 284                         case (JOIN):    /* join a group with the lowest avail gid */ 
 285                                 pvm_upkstr( groupname );
 286                                 gid = gs_join( groupname, tid, hash_list, ngroups );
 287                                 /* tell me if the tid dies */ 
 288                                 if ( pvm_notify( PvmTaskExit, DEADTID, 1, &tid ) < 0 )  
   ...
 327                                 if ( cc )  /* there was error, send back error code */ 
 328                                         SENDINTRESULT( cc, tid, msgtag, "gs_handle(bcast)" ) 
 329                                 else  /* send the already-packed tid-list */ 
 330                                 {
 331                                         PK_STATE( tid, gstate, groupname, hash_list,
 332                                                         ngroups, "gs_handle(bcast)" );
 333                                         SENDRESULT( tid, msgtag, "gs_handle(bcast)" );
 334                                 }
 335                                 break;
 336  
 337                         case (GSIZE):   /* return the current group size */ 
 338                                 pvm_upkstr( groupname );
 339                                 size = gs_gsize( groupname, hash_list, ngroups,
 340                                                 &gstate );
 341                                 PK_IRESULT( size, "gs_handle(gsize)" );
 342                                 PK_STATE( tid, gstate, groupname, hash_list, ngroups,
*groupname is uninitialized343                                                 "gs_handle(gsize)" );   /* Uninitialized Variable (ID: 22193.29362) */
     /kat0/fletcher/SATE/2010/pvm3/pvmgs/pvmgs_func.c
     Enter gs_handle / gs_group
 375   gs_group(groupname, hash_list, ngroups, create) 
 376   char *groupname;
 377   GROUP_LIST_PTR hash_list;
 378   int *ngroups;
 379   int create;
 380   {
 381    
 382           GROUP_LIST_PTR listentry;
 383    
*groupname is uninitialized384           listentry = gs_hash_name(groupname, hash_list, ngroups, create);
       Enter gs_handle / gs_group / gs_hash_name
 255     gs_hash_name(name, hash_list, ngroups, create) 
 256     char *name;
 257     GROUP_LIST_PTR hash_list;
 258     int *ngroups;
 259     int create;
 260     {
 261             char *key;
 262      
 263             int hash_index;
 264             int len = 0;
 265             int match;  
 266             int relation;
 267             int sum = 0;  
 268      
 269             GROUP_LIST_PTR current;
 270             GROUP_LIST_PTR listentry;
 271             GROUP_LIST_PTR prev;
 272      
 273             GROUP_STRUCT_PTR group;
 274      
*name is uninitialized275             if (name == (char *) NULL || *name == '\0')      /* Uninitialized Variable */
       Exit gs_handle / gs_group / gs_hash_name
     Exit gs_handle / gs_group
Preconditions
&$unknown_14729347 >= 1
msgtag = 7
pvmtoplvl != 0
Postconditions
cc' = 0
create' = 0
create' = 0
groupname' = &$heap_465050
groupname' = &$heap_465050
gstate' = 1
hash_list' = hash_list
hash_list' = hash_list
bytes_after(&$heap_465050)' = &$unknown_14729347 + 1
$heap_465050' is allocated by malloc
$heap_465050' is allocated
bytes_before(&$heap_465050)' = 0
len' = &$unknown_14729347
len' = 0
maxntids' = 0
mxupklen' = &$unknown_14729347
name' = &$heap_465050
ngroups' = ngroups
ngroups' = ngroups
nmem_onhostv' = 0
pcoordv' = 0
sum' = 0
tidlist' = 0




Change Warning 22190.29359 : Uninitialized Variable

Priority:
State:
Finding:
Owner:
Note: