Safely handle case of zero size buffer.