summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwalter harms <wharms@bfs.de>2010-09-22 19:25:20 +0200
committerAlan Coopersmith <alan.coopersmith@oracle.com>2010-09-22 19:30:02 -0700
commitd53a3deb52100596bef9fb7b6c6e7ba15ed18bda (patch)
tree1f335f47e5f4e59320c78c02668ce1159d99d101
parent47e73791d4a88e59a797e9dde1ab2d5f58ff774c (diff)
fix dereference in TMprint.c
the current codes checks for eventWidget == NULL after accessing eventWidget->core.tm.proc_table now it checks for eventWidget before access eventWidget->core.tm.proc_table. Signed-off-by: walter harms <wharms@bfs.de> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--src/TMprint.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/TMprint.c b/src/TMprint.c
index 56f7de1..1aceedb 100644
--- a/src/TMprint.c
+++ b/src/TMprint.c
@@ -782,12 +782,16 @@ void _XtDisplayInstalledAccelerators(
PrintRec stackPrints[STACKPRINTSIZE];
PrintRec *prints;
TMShortCard numPrints, maxPrints;
- TMBindData bindData = (TMBindData) eventWidget->core.tm.proc_table;
+ TMBindData bindData ;
TMComplexBindProcs complexBindProcs;
if ((eventWidget == NULL) ||
- ((xlations = eventWidget->core.tm.translations) == NULL) ||
- (bindData->simple.isComplex == False))
+ (eventWidget->core.tm.translations == NULL) )
+ return;
+
+ xlations = eventWidget->core.tm.translations;
+ bindData = (TMBindData) eventWidget->core.tm.proc_table;
+ if (bindData->simple.isComplex == False)
return;
sb->current = sb->start = __XtMalloc((Cardinal)1000);