Text  |   XML   |   Visible Warnings:

Pvm : Pvm analysis 1 : Uninitialized Variable  at pvmgs_func.c:280

Categories: LANG.MEM.UVAR CWE:457
Warning ID: 2937.3020
Procedure: gs_hash_name
Trace: View
Modified: Wed Sep 2 12:53:18 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
   /u1/paul/SATE/2010/c/pvm/pvm3/pvmgs/pvmgsu_core.c
   Enter gs_cachegroup
 792 gs_cachegroup(sgroup_list, ngroups, rsgroup) 
 793 GROUP_LIST_PTR sgroup_list;
 794 int *ngroups;
 795 GROUP_STRUCT_PTR *rsgroup;
 796 {
 797         char *newname = (char *) NULL;  
 798  
 799         int info;
 800         int len;
 801  
 802         GROUP_STRUCT_PTR sgroup;  
 803  
 804         *rsgroup = (GROUP_STRUCT_PTR) NULL;
 805  
 806         if ( (info = pvm_upkint(&len,1,1))  < 0 )
 807                 DO_ERROR_RTN( info, "gs_cachegroup" );
 808  
 809         if (len < 0)                  /* didn't get a valid groupname     */   /* Uninitialized Variable (ID: 2939.3022) */
 810                 return(-1);
 811  
 812         if ( (newname = (char *) PVM_ALLOC(sizeof(char)*(len + 1),
true813                         "gs_cachegroup") ) == (char *) NULL)  
 814                 DO_ERROR_RTN( PvmNoMem, "gs_cachegroup" );
 815  
 816         if ( (info = pvm_upkstr(newname))  < 0  )
 817         {
 818                 PVM_FREE(newname);
 819                 DO_ERROR_RTN( info, "gs_cachegroup" );
 820         }
 821  
*newname is uninitialized822         sgroup = gs_group(newname, sgroup_list, ngroups, CREATE);
     /u1/paul/SATE/2010/c/pvm/pvm3/pvmgs/pvmgs_func.c
     Enter gs_cachegroup / gs_group
*$param_1 is uninitialized375   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_cachegroup / gs_group / gs_hash_name
*$param_1 is uninitialized255     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      
 275             if (name == (char *) NULL || *name == '\0')    /* Uninitialized Variable (ID: 2938.3021) */
 276                     return( (GROUP_LIST_PTR) NULL);  /* Null group name error      */ 
 277      
 278             /* The following is the hash algorithm.                            */ 
*name is uninitialized279             key = name;  
*key is uninitialized280             while (*key != '\0')  /* sum all the characters in the string      */      /* Uninitialized Variable */
       Exit gs_cachegroup / gs_group / gs_hash_name
     Exit gs_cachegroup / gs_group
Preconditions
$heap_242610 != 0
strlen(&$heap_242610) != 0
pvmrbuf != 0
pvmtoplvl != 0
pvmtrc.trctid != pvmmytid
pvmtrc.trctid >= 1
Postconditions
create' = 1
create' = 1
groupname' = &$heap_242610
hash_list' = $param_1
hash_list' = $param_1
$heap_242610' is allocated by malloc
$heap_242610' is allocated
bytes_before(&$heap_242610)' = 0
info' >= 0
key' = &$heap_242610
len' >= 0
len' = 0
name' = &$heap_242610
newname' = &$heap_242610
ngroups' = $param_2
ngroups' = $param_2
ngroups' = $param_2
rsgroup' = $param_3
sgroup_list' = $param_1
sum' = 0




Change Warning 2937.3020 : Uninitialized Variable

Priority:
State:
Finding:
Owner:
Note: