Skip to content

Commit

Permalink
Do not form a tuple with unitialized area
Browse files Browse the repository at this point in the history
  • Loading branch information
za-arthur committed Apr 16, 2018
1 parent 97441e1 commit 8322d6c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ruminsert.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ RumFormTuple(RumState * rumstate,
{
itup = repalloc(itup, newsize);

memset((char *) itup + IndexTupleSize(itup),
0, newsize - IndexTupleSize(itup));
/* set new size in tuple header */
itup->t_info &= ~INDEX_SIZE_MASK;
itup->t_info |= newsize;
Expand Down
2 changes: 2 additions & 0 deletions src/rumvacuum.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ RumFormTuple(RumState * rumstate,
{
itup = repalloc(itup, newsize);

memset((char *) itup + IndexTupleSize(itup),
0, newsize - IndexTupleSize(itup));
/* set new size in tuple header */
itup->t_info &= ~INDEX_SIZE_MASK;
itup->t_info |= newsize;
Expand Down

0 comments on commit 8322d6c

Please sign in to comment.