YAMAMOTO Takashi wrote:
Would a dereference of the NULL ptr not cause immediate failure? As opposed to dereference of garbage ptr which may or may not fail immediately? and in such a case potentially corrupt some other (possibly unrelated) memory which would lead to a fault/crash later that were harder to trace back to the original bad dereference?what i don't understand here is, why you think NULL initialization is better wrt future bugs.
Maybe this is userland thinking and things are different in the kernel.
Agreed, but I think if things were assigned to known values before conditional expressions involving them it can avoid accidents.as it's impossible to predict what kind of bugs we'll have here, i don't think you can say the change will help or hurt.
Tyler