[OpenJDK 2D-Dev] RFR: 8262829: Native crash in Win32PrintServiceLookup.getAllPrinterNames()

Alexey Ivanov aivanov at openjdk.java.net
Fri Mar 5 10:56:53 UTC 2021

On Fri, 5 Mar 2021 03:49:22 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

>> I guess since we are changing this method anyway, can we use PRINTER_ENUM_CONNECTIONS flag instead of hardcoded 4 so that it is more informative!!
> ok, it is for flags and not for level. please ignore

> Don't we need to check that this method call succeeds? Probably it is a crash reason when the EnumPrinters fails but we use cbNeeded anyway for array allocation?

`EnumPrinters` always returns failure here because zero-sized buffer is too small to contain any data.


PR: https://git.openjdk.java.net/jdk/pull/2836

More information about the 2d-dev mailing list