<AWT Dev> RFR(M): 8170525: Fix minor issues in awt coding

Lindenmaier, Goetz goetz.lindenmaier at sap.com
Wed Nov 30 13:12:13 UTC 2016


I'd like to propose a row of smaller fixes where code is noted down a bit questionable.
SAP's quality process requires that we fix these in our internal delivery, and I
Would like to share my fixes with openJdk.  Some of these fixes are of more
theoretical nature as how I understand the code paths never allow the
problematic situation, but fixing it nevertheless assures that nothing is
overseen if the code changes.  Most changes are in  libawt_xawt, some
are in libsunec.

I'd appreciate a review:

Changes in detail:


One might overrun the 100 byte fixed-size string statusWindow->status by copying text->string.multi_byte without checking the length.


This less-than-zero comparison of an unsigned value is never true.

Using uninitialized value color. Field color.alpha is uninitialized.
E.g. used at gtk3_interface.c:2287.


Using uninitialized value ret_timeout.
E.g. in XToolkit.c:6809.


Argument is incompatible with corresponding format string conversion.


Overflowed or truncated value (or a value computed from an overflowed or truncated value) (gdk_scale > 0) ? native_scale * (double)gdk_scale : native_scale used as return value.


Using uninitialized value k.dp when calling mp_clear.


You might overrun the 291 byte fixed-size string genenc by copying curveParams->geny without checking the length.
Added sanity check before doing the string concatenation.


Using uninitialized value kt.flag when calling *group->point_mul. (The function pointer resolves to ec_GF2m_pt_mul_mont.)


Using uninitialized value s. Field s.flag is uninitialized when calling s_mp_exch.
Using uninitialized value tmp. Field tmp.flag is uninitialized when calling s_mp_exch
Using uninitialized value t.dp when calling mp_clear.


Using uninitialized value *ckpInitArgs. Field ckpInitArgs->flags is uninitialized when calling memcpy.


Using uninitialized value lockInfo.rasBase when calling BN_GetPixelPointer.


You might overrun the 512 byte fixed-size string fontDirPath by copying DirP->name[index] without checking the length.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20161130/fb81ebc6/attachment.html>

More information about the awt-dev mailing list