git: 853f1cb7c8c3 - main - x11-toolkits/open-motif*: MenuShell: computing position uses RC_Type() expecting RowColumn

From: Cy Schubert <cy_at_FreeBSD.org>
Date: Tue, 05 Dec 2023 00:09:24 UTC
The branch main has been updated by cy:

URL: https://cgit.FreeBSD.org/ports/commit/?id=853f1cb7c8c329402edb90430d709d9dda121efd

commit 853f1cb7c8c329402edb90430d709d9dda121efd
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2023-12-04 23:37:10 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2023-12-05 00:02:04 +0000

    x11-toolkits/open-motif*: MenuShell: computing position uses RC_Type() expecting RowColumn
    
    To compute the position of a menu to display, in some cases the
    position is computed invoking RC_Type() that expects a RowColumn
    widget. One case was not verifying this hence leading to coredump.
    
    Obtained from:  https://sourceforge.net/p/motif/code/merge-requests/5/
---
 x11-toolkits/open-motif-devel/Makefile                       |  2 +-
 x11-toolkits/open-motif-devel/files/patch-lib_Xm_MenuShell.c | 10 ++++++++++
 x11-toolkits/open-motif/Makefile                             |  2 +-
 x11-toolkits/open-motif/files/patch-lib_Xm_MenuShell.c       | 10 ++++++++++
 4 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/x11-toolkits/open-motif-devel/Makefile b/x11-toolkits/open-motif-devel/Makefile
index 4a9878e10e31..d34714852e78 100644
--- a/x11-toolkits/open-motif-devel/Makefile
+++ b/x11-toolkits/open-motif-devel/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	open-motif
 PORTVERSION=	${COMMIT_DATE}
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	x11-toolkits
 PKGNAMESUFFIX=	-devel
 
diff --git a/x11-toolkits/open-motif-devel/files/patch-lib_Xm_MenuShell.c b/x11-toolkits/open-motif-devel/files/patch-lib_Xm_MenuShell.c
new file mode 100644
index 000000000000..af501e746451
--- /dev/null
+++ b/x11-toolkits/open-motif-devel/files/patch-lib_Xm_MenuShell.c
@@ -0,0 +1,10 @@
+--- lib/Xm/MenuShell.c.orig	2023-02-15 16:42:34.000000000 -0800
++++ lib/Xm/MenuShell.c	2023-12-04 15:33:32.718284000 -0800
+@@ -988,6 +988,7 @@
+    if (bottomEdgeOfMenu >= (Position)dispHeight)
+    {
+       if (pulldown_button && XtParent(pulldown_button) &&
++		XmIsRowColumn(XtParent(pulldown_button)) &&
+ 	  (RC_Type(XtParent(pulldown_button)) == XmMENU_BAR))
+       {
+ 	 Position y_temp = *y;
diff --git a/x11-toolkits/open-motif/Makefile b/x11-toolkits/open-motif/Makefile
index 0535b7221a7f..47eb20ebd003 100644
--- a/x11-toolkits/open-motif/Makefile
+++ b/x11-toolkits/open-motif/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	open-motif
 PORTVERSION=	2.3.8
-PORTREVISION=	3
+PORTREVISION=	4
 CATEGORIES=	x11-toolkits
 # MASTER_SITES=	SF/${PORTNAME}/Motif%202.3.4%20Source%20Code/
 MASTER_SITES=	SF/motif/Motif%20${PORTVERSION}%20Source%20Code/
diff --git a/x11-toolkits/open-motif/files/patch-lib_Xm_MenuShell.c b/x11-toolkits/open-motif/files/patch-lib_Xm_MenuShell.c
new file mode 100644
index 000000000000..af94efe107ae
--- /dev/null
+++ b/x11-toolkits/open-motif/files/patch-lib_Xm_MenuShell.c
@@ -0,0 +1,10 @@
+--- lib/Xm/MenuShell.c.orig	2017-08-16 17:38:43.000000000 -0700
++++ lib/Xm/MenuShell.c	2023-12-04 15:33:35.350531000 -0800
+@@ -988,6 +988,7 @@
+    if (bottomEdgeOfMenu >= (Position)dispHeight)
+    {
+       if (pulldown_button && XtParent(pulldown_button) &&
++		XmIsRowColumn(XtParent(pulldown_button)) &&
+ 	  (RC_Type(XtParent(pulldown_button)) == XmMENU_BAR))
+       {
+ 	 Position y_temp = *y;