by acqq · 9y ago · 0 comments
I wouldn't call it "malformed" -- the OS simply returned a null pointer: "the field that is supposed to point to the buffer containing the resulting string is NULL." Which in C means "nothing there." And the Java native interface code didn't check for that (it could have returned an empty Java string in that case), but dereferenced the null pointer instead. "Fail fast" indeed.
1: https://msdn.microsoft.com/en-us/library/windows/desktop/bb7...
https://msdn.microsoft.com/en-us/library/windows/desktop/bb7...
That would mean the API behaved according to the specs. See an example here, it's impossible for the call to destroy the pointer to STRRET:
https://msdn.microsoft.com/en-us/library/windows/desktop/bb7...