|
|
|
|
|
by hedora
30 days ago
|
|
You have to handle NULL in C, or your program crashes (though I suppose a misguided optimization of strcmp could do "a == b || really_strcmp(a, b)", which gets us back to your bug). Also, in things like rust you can just do result.unwrap() if you want. In general, language constructs don't really save you from bad programmers. |
|
But it crashes at runtime, so such a bug can exist for years with nobody noticing.
The existence of such bugs is what motivated the musl developers to return "*" instead of NULL.