Re: Fix condition in shm_toc and remove unused function shm_toc_freespace.

Поиск
Список
Период
Сортировка
От Zhang Mingli
Тема Re: Fix condition in shm_toc and remove unused function shm_toc_freespace.
Дата
Msg-id 70ce9710-e9ed-4a25-a327-88de830b8cf6@Spark
обсуждение исходный текст
Ответ на Fix condition in shm_toc and remove unused function shm_toc_freespace.  (Zhang Mingli <zmlpostgres@gmail.com>)
Ответы Re: Fix condition in shm_toc and remove unused function shm_toc_freespace.  (Richard Guo <guofenglinux@gmail.com>)
Список pgsql-hackers
Hi,

On Jan 12, 2023, 14:34 +0800, Zhang Mingli <zmlpostgres@gmail.com>, wrote:
Hi, hackers

Some conditions in shm_toc_insert and shm_toc_allocate are bogus, like:
if (toc_bytes + nbytes > total_bytes || toc_bytes + nbytes < toc_bytes)
Remove the condition `toc_bytes + nbytes < toc_bytes` and take a sizeof(shm_entry) into account in shm_toc_allocate though 
shm_toc_allocate does that too.
  shm_toc_insert does that too, and  we can report error earlier.

Regards,
Zhang Mingli

В списке pgsql-hackers по дате отправления:

Предыдущее
От: John Naylor
Дата:
Сообщение: Re: Small miscellaneus fixes (Part II)
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: On login trigger: take three