Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Null Pointer Dereference  at pvmgs_func.c:1138

Categories: LANG.MEM.NPD CWE:476
Warning ID: 555.29349
Procedure: gs_newhost
Trace: view
Modified: Thu Nov 26 11:38: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/pvmgs/pvmgs_func.c
   Enter gs_newhost
 1115 gs_newhost(group,index) 
 1116 GROUP_STRUCT_PTR group;
 1117 int index;
 1118 {
 1119         int i;
 1120         int oldmaxhosts;  
 1121  
 1122         if (index >= 0)  
 1123                 return(index);
 1124  
 1125         oldmaxhosts = group->maxhosts;
 1126  
 1127         group->np_onhost = gs_realloc_int_array(group->nhosts + 1,  
 1128                         &(group->maxhosts), group->np_onhost, DELTANTIDS, 0, "gs_newhost");  
 1129  
 1130         group->maxhosts = oldmaxhosts;
 1131  
 1132         group->pcoord = gs_realloc_int_array(group->nhosts + 1,  
true1133                         &(group->maxhosts), group->pcoord, DELTANTIDS, NOTID, "gs_newhost");  
 1134         index = (-1 - index);     /* where new info should be stored */ 
 1135  
 1136         for (i = group->nhosts; i > index; i --)  
 1137         {
group->pcoord <= 40951138                 group->pcoord[i] = group->pcoord[i-1];     /* Null Pointer Dereference */
Preconditions
index <= -1
group->nhosts >= group->maxhosts
group->nhosts >= -1 * index
group->nhosts >= 1
group->maxhosts >= -1
Postconditions
*stderr' is allocated by fopen
bytes_before(stderr)' = 0
errno' != 0
bytes_after(&$heap_460921)' = 4 * group->maxhosts + 4
$heap_460921' is allocated by malloc
bytes_before(&$heap_460921)' = 0
i' = group->nhosts
index' = -1 * index - 1
oldmaxhosts' = group->maxhosts




Change Warning 555.29349 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: