Home | Software Map | Motif Forums | Bug Home sponsored by ICS 
Bugzilla Bug
  1390
     Query page      Enter new bug
Bug#:1390 Platform: Version:
Product: OS: Reporter:umar@compsci.cas.vanderbilt.edu (S. Umar)
Status: CLOSED Priority: Cc:
Resolution: FIXED Severity: Component:
Assigned To: openmotif-devel@motifzone.net Target Milestone:
URL:
Summary:
Attachments: 10/03/07 12:51Patch that make selectedPositions up-to-date before operations on it
Create a new attachment (proposed patch, testcase, etc.)
Bug 1390 depends on: Show dependency tree
Show dependency graph
Bug 1390 blocks:
Votes for bug 1390:    Vote for this bug

Additional Comments:


Leave as CLOSED FIXED
Reopen bug

View Bug Activity Format For Printing
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
This is Mr. Samsa: the Open Motif bug system using Bugzilla. For more information about what Bugzilla is and what it can do, see mozilla.org's bug pages.
New | Query | bug # | Reports | New account | Log in