Bug 167701 - Fix for XmList out of bound accesses
Summary: Fix for XmList out of bound accesses
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: openmotif
Version: 4.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Thomas Woerner
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 180356 181409
TreeView+ depends on / blocked
 
Reported: 2005-09-07 12:14 UTC by Bastien Nocera
Modified: 2007-11-30 22:07 UTC (History)
1 user (show)

Fixed In Version: RHBA-2006-0292
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-08-10 21:16:46 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
openmotif-list-overrun2.patch (1.72 KB, patch)
2005-09-07 12:14 UTC, Bastien Nocera
no flags Details | Diff
xmbug.c (1.73 KB, text/plain)
2005-09-07 12:16 UTC, Bastien Nocera
no flags Details
xmrotate.c (2.21 KB, text/plain)
2005-09-07 12:18 UTC, Bastien Nocera
no flags Details
New overrun patch. (1.72 KB, patch)
2006-01-30 16:45 UTC, Thomas Woerner
no flags Details | Diff
openMotif-2.2.3-overrun.patch (1.72 KB, patch)
2006-02-01 17:06 UTC, Thomas Woerner
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2006:0292 0 normal SHIPPED_LIVE openmotif bug fix update 2006-08-09 04:00:00 UTC

Description Bastien Nocera 2005-09-07 12:14:50 UTC
There are a number of problems in lib/Xm/List.c in openmotif, where items
outside the list would be accessed, usually causing a SEGV.

Patch attached. Testcases coming as well.

Comment 1 Bastien Nocera 2005-09-07 12:14:50 UTC
Created attachment 118552 [details]
openmotif-list-overrun2.patch

Comment 2 Bastien Nocera 2005-09-07 12:16:53 UTC
Created attachment 118553 [details]
xmbug.c

Click on one element in the list (without releasing the mouse button), then
release the button when the item has been removed from the list.
This usually causes a segfault.

Comment 3 Bastien Nocera 2005-09-07 12:18:06 UTC
Created attachment 118554 [details]
xmrotate.c

Select multiple items and extend the selection from back to top and vice-versa,
a segfault should arise soon after multiple extensions or selections.

Comment 4 Bastien Nocera 2005-09-07 12:20:54 UTC
Note that this change is on purpose. start is decreased by one when called as an
argument of SelectRange. start == 0 would cause the index in SelectRange to be -1...

@@ -4683,7 +4693,7 @@ SelectElement(Widget wid,
 	    SelectRange(lw, item, end + 1, sel);
 	  else if ((i > end) && (i <= start))
 	    RestoreRange(lw, end, i - 1, FALSE);
-	  else if (i > start)
+	  else if (i > start && start > 0)
 	    {
 	      if (sel)
 		SelectRange(lw, end, start - 1, FALSE);

Comment 7 Thomas Woerner 2006-01-30 16:45:28 UTC
Created attachment 123873 [details]
New overrun patch.

Analyzing the patch and the code, I have fixed the code in a different way.
Please find attached the new patch.

Comment 8 Thomas Woerner 2006-02-01 17:06:18 UTC
Created attachment 123976 [details]
openMotif-2.2.3-overrun.patch

Revised version from ICS (upstream) with an additional fix.

Comment 16 Red Hat Bugzilla 2006-08-10 21:16:46 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2006-0292.html



Note You need to log in before you can comment on or make changes to this bug.