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

2023-01-13 Thread Zhang Mingli
Hi, Regards, Zhang Mingli On Jan 12, 2023, 16:54 +0800, Richard Guo , wrote: > > On Thu, Jan 12, 2023 at 2:50 PM Zhang Mingli wrote: > > On Jan 12, 2023, 14:34 +0800, Zhang Mingli , wrote: > > > Some conditions in shm_toc_insert and shm_toc_allocate are bogus, like: > > > if (toc_bytes

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

2023-01-12 Thread Richard Guo
On Thu, Jan 12, 2023 at 2:50 PM Zhang Mingli wrote: > On Jan 12, 2023, 14:34 +0800, Zhang Mingli , wrote: > > 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 +

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

2023-01-11 Thread Zhang Mingli
Hi, On Jan 12, 2023, 14:34 +0800, Zhang Mingli , 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

Fix condition in shm_toc and remove unused function shm_toc_freespace.

2023-01-11 Thread Zhang Mingli
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