Query page
Enter new bug
| Description: |
Opened: 2007-09-22 10:48 |
Hi,
Different from bug#1389 there is another nedit crash bug:
http://www.nedit.org/pipermail/develop/2007-September/013483.html
This bug was happening on x86_64 systems and not on i386. I tracked
it down to a particular line in lib/Xm/List.c and fixed it by checking
the input. I am not a c programmer (fortran) and I am not sure whether
this is a motif bug or the call from nedit is wrong for 64bit systems.
But I guess nothing should make things segfault!. Below is my small
patch. Thanks,
============================================================================
--- openmotif-2.3.0/lib/Xm/List.c.old 2007-02-23 11:13:38.000000000
-0600
+++ openmotif-2.3.0/lib/Xm/List.c 2007-09-13 09:32:53.000000000
-0500
@@ -3651,12 +3651,15 @@
XmStringFree(lw->list.items[pos]);
lw->list.items[pos] = XmStringCopy(item);
/*Selected items should be replaced also*/
- for(i=0; i<lw->list.selectedItemCount; i++)
- if(lw->list.selectedPositions[i]==pos+1) {
- XmStringFree(lw->list.selectedItems[i]);
- lw->list.selectedItems[i]=XmStringCopy(item);
- }
-
+ if ((lw->list.selectedPositions != NULL) &&
+ (lw->list.selectedPositionCount > 0))
+ {
+ for(i=0; i<lw->list.selectedItemCount; i++)
+ if(lw->list.selectedPositions[i]==pos+1) {
+ XmStringFree(lw->list.selectedItems[i]);
+ lw->list.selectedItems[i]=XmStringCopy(item);
+ }
+ }
}
^L
===========================================================================
------- Additional Comments From Yura Syrota 2007-10-03 12:51 -------
Created an attachment (id=142)
Patch that make selectedPositions up-to-date before operations on it
------- Additional Comments From Yura Syrota 2007-10-03 12:55 -------
Seems selectedPositions is not up-da-date in the function, proposed patch fixes
the bug.
------- Additional Comments From Yura Syrota 2007-10-03 13:19 -------
*** Bug 1391 has been marked as a duplicate of this bug. ***
------- Additional Comments From Yura Syrota 2007-10-05 04:20 -------
Fixed as proposed in openmotif_2_3 and HEAD branches
------- Additional Comments From timbe@lsl.co.uk 2007-10-12 13:46 -------
*** Bug 1391 has been marked as a duplicate of this bug. ***
Query page
Enter new bug