RE: malloc/calloc return value NULL check

2025-07-15 Thread Baesken, Matthias
To: Baesken, Matthias Cc: build-dev@openjdk.org Subject: Re: malloc/calloc return value NULL check Absolutely, yes. The larger the allocated size, the more important. Linux kernel, by default, only protects a small area against NULL accesses; depending on distro, 4KB or 64 (?) KB. And the JVM,

Re: malloc/calloc return value NULL check

2025-07-13 Thread David Holmes
On 11/07/2025 10:57 pm, Baesken, Matthias wrote: Hi, when playing around with the  GCC static analyzer  ( https:// developers.redhat.com/articles/2022/04/12/state-static-analysis-gcc-12- compiler )   I no

Re: malloc/calloc return value NULL check

2025-07-11 Thread Thomas Stüfe
Absolutely, yes. The larger the allocated size, the more important. Linux kernel, by default, only protects a small area against NULL accesses; depending on distro, 4KB or 64 (?) KB. And the JVM, at various places, allocates in low-area ranges. So accessing NULL+ can actually land you at a valid u