XForms: possible bug in forms.c

From: Greg Hosler (hosler@lugs.org.sg)
Date: Mon Apr 15 2002 - 10:21:37 EDT


# To subscribers of the xforms list from Greg Hosler <hosler@lugs.org.sg> :

Hi,

I just ran a valgrind on xfmail, looking for a bug, and came across the
following in xforms:

==9753== Conditional jump or move depends on uninitialised value(s)
==9753== at 0x810D145: do_keyboard (forms.c:1550)
==9753== by 0x810D909: do_interaction_step (forms.c:1842)
==9753== by 0x810E01B: fl_treat_interaction_events (forms.c:2072)
==9753== by 0x810E14A: fl_do_only_forms (forms.c:2136)

==9753== Conditional jump or move depends on uninitialised value(s)
==9753== at 0x810D18D: do_keyboard (forms.c:1552)
==9753== by 0x810D909: do_interaction_step (forms.c:1842)
==9753== by 0x810E01B: fl_treat_interaction_events (forms.c:2072)
==9753== by 0x810E14A: fl_do_only_forms (forms.c:2136)

==9753== Conditional jump or move depends on uninitialised value(s)
==9753== at 0x810D1BA: do_keyboard (forms.c:1563)
==9753== by 0x810D909: do_interaction_step (forms.c:1842)
==9753== by 0x810E01B: fl_treat_interaction_events (forms.c:2072)
==9753== by 0x810E14A: fl_do_only_forms (forms.c:2136)

these are all complaining that keysym is uninitialized. In looking at the code,
I can see at least one case where this will happen, and that would be when
fl_XLookupString calls XLookupString (because of fl_context->xic being NULL),
and XLookupString returns a null length. Similiarly upon reading the manpage
for XmbLookupString (the other possibil path in fl_XLookupString()), it is
possible for this routine to also not return a keysym under certain conditions.

In the cases where there is not a valid returned keysym, do_keyboard ought not
to be looking at it.

best rgds,

-Greg

+---------------------------------------------------------------------+
   You can release software that's good, software that's inexpensive, or
   software that's available on time. You can usually release software
   that has 2 of these 3 attributes -- but not all 3.
| Greg Hosler hosler@lugs.org.sg |
+---------------------------------------------------------------------+
_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuhs.mil or see
http://bob.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://world.std.com/~xforms
List Archive: http://bob.usuhs.mil/mailserv/list-archives/



This archive was generated by hypermail 2b29 : Wed May 01 2002 - 13:54:19 EDT