I don't think I follow how tests results were translated to code changes. If it crashes on NULL buffer on Windows, which it does, why are we not doing the same? Having 0 length and NULL buffer is fine, having non-zero length and NULL buffer crashes, so why are we checking output pointer?