[Not really OT] Crowdstrike Analysis: It was a NULL pointer from the memory unsafe C++ language.

kdevel kdevel at vogtner.de
Sat Jul 27 19:25:59 UTC 2024


On Saturday, 27 July 2024 at 18:23:28 UTC, Walter Bright wrote:
> It's true that many algorithms depend on a null pointer being a 
> "sentinel", and people sometimes forget to check for it. That 
> means:
>
> 1. if they forgot to check for the null special case, then the 
> seg fault tells them where the error is
>
> 2. if null was supposed not ever happen, then the seg fault 
> tells where the error is
>
> Dereferencing a null pointer is always a bug.

The derefencing is not the bug, it is at best one of its symptoms.

In D (in constrast to C++) the null ptr dereference is 
implementation defined.[1] I.e. if you need a test program that 
dereferences a null ptr you can write one in D (you cannot in 
C++). If that program does what it is expected ("[The] program 
will be aborted" [1]) one can hardly say that such a program 
contains a bug.

[1] https://dlang.org/spec/type.html#pointers


More information about the Digitalmars-d mailing list