There is no reliable way to distinguish a zero-size buffer from a non-buffer based on the return values. A NULL with zero size is returned for a non-buffer. The same values may be returned for a zero-size buffer (although it is also possible that a non-NULL pointer is returned).