scan the entire buffer for null bytes