[OpenJDK 2D-Dev] [XS] RFR : JDK-8204085: avoid printing uninitialized pointer in java.desktop/windows/native/libawt/java2d/windows/GDIWindowSurfaceData.cpp

Baesken, Matthias matthias.baesken at sap.com
Wed May 30 14:11:58 UTC 2018


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/


Thanks, Matthias

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/2d-dev/attachments/20180530/d8ecab99/attachment-0001.html>


More information about the 2d-dev mailing list