NULL is a valid allocation result when trying to allocate 0 bytes. (At least if by “allocation” you follow malloc()/realloc() rules.)
Thus, given that this is a C/C++ level API, the only reasonable interpretation of the documentation is that if the size is too small, the library will somehow re-allocate the provided pointer, copy whatever data it already wrote, and keep going.
How can the library do this?
realloc(NULL, size) is a valid C/C++ strategy.
delete NULL and delete NULL are also valid C/C++ strategies.
memcpy(dst, NULL, 0) is a valid C/C++ operation.
Thus, passing in size 0 and pointer NULL will force the library to allocate a new buffer, and update the pointer/size.
Once you have a pointer/size allocated by the driver, you can hang on to it, and whatever the driver does (realloc(), or memcpy()/delete/new, or whatever) should keep being correct.
I have no idea what usage the NVIDIA will ACTUALLY support. The interface, as designed, is clearly designed and documented by people who aren’t particularly experienced or skilled in interface design and publication, or perhaps people who were given 45 minutes to finish the job from scratch, so it may very well be that there’s no safe way to use this API at all. But if we assume that their developers have basic C/C++ standard library understanding, ideally from a Linux/glibc environment, then the above reasoning should hold.