Dereferencing a null pointer results in undefined behavior. In practice it usually means that my program will crash. But why doesn\'t the OS crash? Because if my progra
There are no rules of logical transitivity when it comes to UB. Your assumption is wrong.
UB does mean that anything can happen, so on a poorly written OS, your program might actually crash the OS. Don't rule it out.
Also, your program doesn't crash because you dereference a NULL
pointer. It crashes because the OS tells it to crash.