Guard against NULL from byte buffers/arrays.

Two potential issues reported by clang.