load_buffer_impl always checks if buffer is valid pointer and size > 0

added some tests to force invalid buffer and size = 0