Re:CVE-2023-4863: Heap buffer overflow in WebP (Chrome)
by astrange on Tuesday September 12, 2023 @02:08PM
(#37485101)
That's not true, it is merely true on most ABIs. The only case where C really erases this information is casting to uintptr_t and back.
Re:CVE-2023-4863: Heap buffer overflow in WebP (Chrome)
by Gibbon1 on Tuesday September 12, 2023 @02:41PM
(#37485698)
gcc also has some builtins to check pointer sizes when the compiler is able to figure it out.
https://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Object-Size-Che...
Which is why I harp on the idea that the real problem is the gold bricks on WG14 who are intentionally blocking improvements to make C safer.
Also point out that if you can implement C on 16bit 0x86's segmented architecture you can certainly implement C with phat pointers too.
Where?
Once you have a bare pointer, you've lost track of what the original definition might have been, so you (the compiler / runtime / programmer) have no way of knowing that you've exceeded the size.