RFR [XS]: 8234968: check calloc rv in libinstrument InvocationAdapter
Thomas Stüfe
thomas.stuefe at gmail.com
Fri Nov 29 06:29:52 UTC 2019
Hi Matthias,
I am not certain the callers are prepared to handle NULL.
This is used in a chain of TRANSFORM macro calls which AFAICS do not handle
NULL; e.g. , at 872, we pass the returned pointer to
convertUft8ToPlatformString which passes it on (on Windows) to
MultiByteToWideChar, which does not handle NULL input.
So I wonder whether a clear error message with an exit would be better in
this case. Otherwise we may get a crash just some instructions later.
Cheers, Thomas
On Thu, Nov 28, 2019 at 5:21 PM Baesken, Matthias <matthias.baesken at sap.com>
wrote:
> Hello, please review this small patch .
>
> It adds return value checking for calloc at one place where it is missing .
>
>
>
> Thanks, Matthias
>
>
>
> Bug/webrev :
>
>
>
> https://bugs.openjdk.java.net/browse/JDK-8234968
>
>
>
> http://cr.openjdk.java.net/~mbaesken/webrevs/8234968.1/
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/serviceability-dev/attachments/20191129/0842dae4/attachment-0001.html>
More information about the serviceability-dev
mailing list