Skip to content

Commit

Permalink
prevents uninitialized memeory read, protect ftello once
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Park authored and Mike Park committed Jul 20, 2021
1 parent d55699a commit eb40ba6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ref_part.c
Original file line number Diff line number Diff line change
Expand Up @@ -1665,7 +1665,8 @@ static REF_STATUS ref_part_avm(REF_GRID *ref_grid_ptr, REF_MPI ref_mpi,
REF_FILEPOS conn_offset, faceid_offset;
REF_BOOL swap_endian = REF_FALSE;
REF_BOOL sixty_four_bit = REF_FALSE;
conn_offset = ftello(file);
conn_offset = 0;
if (ref_grid_once(ref_grid)) conn_offset = ftello(file);
faceid_offset = 0;
RSS(ref_part_bin_ugrid_cell(ref_grid_tet(ref_grid), ntet, ref_node, nnode,
file, conn_offset, faceid_offset, swap_endian,
Expand Down

0 comments on commit eb40ba6

Please sign in to comment.