[OpenJDK 2D-Dev] [XS] RFR : JDK-8204085: avoid printing uninitialized pointer in java.desktop/windows/native/libawt/java2d/windows/GDIWindowSurfaceData.cpp
Philip Race
philip.race at oracle.com
Wed May 30 14:25:14 UTC 2018
Yes, please. And it looks fine. We have an internal static code analysis
tool
which should catch this sort of thing but it is weakest on Windows ..
-phil.
On 5/30/18, 7:11 AM, Baesken, Matthias wrote:
>
> Hi Christoph, Sergey and Thomas , thanks for the reviews .
>
> * And make sure you push it to the client repo...
> *
>
> Thanks for pointing this out, otherwise I would have taken the normal
> jdk repo .
>
> Best regards, Matthias
>
> *From:*Langer, Christoph
> *Sent:* Mittwoch, 30. Mai 2018 16:01
> *To:* Baesken, Matthias <matthias.baesken at sap.com>; 2d-dev
> <2d-dev at openjdk.java.net>
> *Subject:* RE: [XS] RFR : JDK-8204085: avoid printing uninitialized
> pointer in
> java.desktop/windows/native/libawt/java2d/windows/GDIWindowSurfaceData.cpp
>
> Hi Matthias,
>
> maybe the code would become nicer if you do it like this:
>
> ...
>
> jobject localObj = env->NewLocalRef(wsdo->peer);
>
> PDATA pData = localObj == NULL ? NULL : JNI_GET_PDATA(localObj);
>
> if (pData == NULL) {
>
> ...
>
> But the change is very trivial and I would be fine with it, as you did
> in the webrev. Do whatever is more convenient to you, no need for
> another webrev.
>
> And make sure you push it to the client repo...
>
> Best regards
>
> Christoph
>
> *From:*Baesken, Matthias
> *Sent:* Mittwoch, 30. Mai 2018 15:33
> *To:* 2d-dev <2d-dev at openjdk.java.net <mailto:2d-dev at openjdk.java.net>>
> *Cc:* Langer, Christoph <christoph.langer at sap.com
> <mailto:christoph.langer at sap.com>>
> *Subject:* [XS] RFR : JDK-8204085: avoid printing uninitialized
> pointer in
> java.desktop/windows/native/libawt/java2d/windows/GDIWindowSurfaceData.cpp
>
> Hi could I please get reviews for this very small change :
>
> In
> java.desktop/windows/native/libawt/java2d/windows/GDIWindowSurfaceData.cpp
> , function GDIWindowSurfaceData_GetComp,
>
> we might print pointer pData in uninitialized state.
>
> This occurs in case localObj == NULL , then we would print pData
> without initialization.
>
> The small fix adds initialization to pData :
>
> Bug:
>
> https://bugs.openjdk.java.net/browse/JDK-8204085
>
> change :
>
> http://cr.openjdk.java.net/~mbaesken/webrevs/8204085/
> <http://cr.openjdk.java.net/%7Embaesken/webrevs/8204085/>
>
> Thanks, Matthias
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/2d-dev/attachments/20180530/ceccfc42/attachment.html>
More information about the 2d-dev
mailing list