Re: Fw: Re: heap_force_common in contrib/pg_surgery/heap_surgery.c has an off by one stack buffer overflow
От
Michael Paquier
Тема
Re: Fw: Re: heap_force_common in contrib/pg_surgery/heap_surgery.c has an off by one stack buffer overflow
Дата
Msg-id
aiEpyJteDv3q-EMi@paquier.xyz
Ответ на
Re: Fw: Re: heap_force_common in contrib/pg_surgery/heap_surgery.c has an off by one stack buffer overflow (surya poondla)
Список
Дерево обсуждения
Re: Fw: Re: heap_force_common in contrib/pg_surgery/heap_surgery.c has an off by one stack buffer overflow 王跃林 <violin0613@tju.edu.cn>
On Wed, Jun 03, 2026 at 03:31:27PM -0700, surya poondla wrote: > Thank you for reporting the issue, I am able to reproduce it on master. > The include_this_tid[] array is sized MaxHeapTuplesPerPage but indexed > using 1-based OffsetNumber, > so the largest legal offset (MaxHeapTuplesPerPage itself) lands one slot > past the end. - bool include_this_tid[MaxHeapTuplesPerPage]; + /* Sized +1 because OffsetNumbers are 1-based and can reach MaxHeapTuplesPerPage. */ + bool include_this_tid[MaxHeapTuplesPerPage + 1]; The offset number begins at 1. Hence, instead of making this array larger by one, you could keep it at the same size and adjust the array index to use (offno - 1) instead. -- Michael
В списке pgsql-bugs по дате отправления
От: Antonin Houska
Дата:
От: Ajin Cherian
Дата: