Null pointer access caused by bad data is entirely conceivable... esp when you overwrite parts of kernel memory with nulls.
I mean that the least you can do before pointer dereference is just check for several bad sentinel values, NULL being one of them.
Seems like a rather amateur mistake to me.
I've been an idiot as well in the past. Happily some of us actually learn though!