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 <[email protected]>
Cc: Langer, Christoph <[email protected]>
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