Re: patch:libXt-1.0.8 fix possible NULL access

2010-10-06 Thread walter harms


Alan Coopersmith schrieb:
 walter harms wrote:
 You appear to have attached a different version of the patch than
 in the body of your e-mail - neither git nor patch can apply either
 one to the current git tree.   After a bit of manual editing I
 finally got one to work, so I fixed the indenting and committed it.
 I am confused, I used the current 1.0.8 as base. Are the problems
 related to the tabs or more ?
 
 The patch in your attachment claimed to delete a /* FIXME: can be NULL */
 comment that wasn't in the original source, and left a trailing space at the
 end of the line that git rejects.  The one in the message body did not show
 the FIXME comment.
 

ok, i see,
i forgot the attach the new patchset after i saw that i left my FIXME comment 

my bad.

BTW:
Intrinsic.c: static char *ExtractLocaleName()
the comment says: Should match the code in Xlib _XlcMapOSLocaleName

but the code in _XlcMapOSLocaleName() look very different. can you take a look 
please ?


re,
 wh
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: patch:libXt-1.0.8 fix possible NULL access

2010-10-05 Thread walter harms


Alan Coopersmith schrieb:
 walter harms wrote:
 hi i got no feedback for my patch
 could you please take a look ? subject:
 patch:libXt-1.0.8 fix possible NULL access
 
 Sorry, it's libXt, which is very near the bottom of most people's
 priority lists, now that most modern desktop software doesn't use
 it (neither Qt or GTK use libXt).

yep, i noticed this is nice because there are not so many changes anymore
gives more time to send fixes :)
and there is still plenty of software that uses Xt

 Adding the check for NULL seems reasonable, but you then switch
 from 4-space to 8-space indents for the code you re-indented.
 Please try to maintain consistency with the surrounding code when
 making changes so the code stays a little more readable.

I am sorry, tabs are always a problem the second patch you noticed
is the original one.

 
 You appear to have attached a different version of the patch than
 in the body of your e-mail - neither git nor patch can apply either
 one to the current git tree.   After a bit of manual editing I
 finally got one to work, so I fixed the indenting and committed it.

I am confused, I used the current 1.0.8 as base. Are the problems
related to the tabs or more ?

re,
 wh

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: patch:libXt-1.0.8 fix possible NULL access

2010-10-05 Thread Alan Coopersmith
walter harms wrote:
 You appear to have attached a different version of the patch than
 in the body of your e-mail - neither git nor patch can apply either
 one to the current git tree.   After a bit of manual editing I
 finally got one to work, so I fixed the indenting and committed it.
 
 I am confused, I used the current 1.0.8 as base. Are the problems
 related to the tabs or more ?

The patch in your attachment claimed to delete a /* FIXME: can be NULL */
comment that wasn't in the original source, and left a trailing space at the
end of the line that git rejects.  The one in the message body did not show
the FIXME comment.


-- 
-Alan Coopersmith-alan.coopersm...@oracle.com
 Oracle Solaris Platform Engineering: X Window System

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


patch:libXt-1.0.8 fix possible NULL access

2010-10-01 Thread walter harms
Hi List,
while testing a static checker, i got warnings about a possible NULL access.
looking into the code i found that GetClassActions() may return NULL
causing table-signature to ask for trouble.

re,
 wh



Honor that GetClassActions() may return NULL.

Signed-off-by: Walter wha...@bfs.de


--- libXt-1.0.8/src/TMaction.c.org  2010-09-29 20:37:48.0 +0200
+++ libXt-1.0.8/src/TMaction.c  2010-09-29 20:39:56.0 +0200
@@ -807,10 +807,12 @@
 if (*num_actions_return) {
list = *actions_return = (XtActionList)
__XtMalloc(*num_actions_return * sizeof(XtActionsRec));
-   table = GetClassActions(widget_class);
-   for (i= (*num_actions_return); --i = 0; list++, table++) {
-   list-string = XrmQuarkToString(table-signature);
-   list-proc = table-proc;
+   table = GetClassActions(widget_class);
+   if (table != NULL ) {
+   for (i= (*num_actions_return); --i = 0; list++, table++) {
+   list-string = XrmQuarkToString(table-signature);
+   list-proc = table-proc;
+   }
}
 }
 UNLOCK_PROCESS;
--- libXt-1.0.8/src/TMaction.c.org	2010-09-29 20:37:48.0 +0200
+++ libXt-1.0.8/src/TMaction.c	2010-09-29 20:39:56.0 +0200
@@ -807,10 +807,12 @@
 if (*num_actions_return) {
 	list = *actions_return = (XtActionList)
 	__XtMalloc(*num_actions_return * sizeof(XtActionsRec));
-	table = GetClassActions(widget_class); /* FIXME: can be NULL */
-	for (i= (*num_actions_return); --i = 0; list++, table++) {
-	list-string = XrmQuarkToString(table-signature);
-	list-proc = table-proc;
+	table = GetClassActions(widget_class); 
+	if (table != NULL ) {
+		for (i= (*num_actions_return); --i = 0; list++, table++) {
+			list-string = XrmQuarkToString(table-signature);
+			list-proc = table-proc;
+		}
 	}
 }
 UNLOCK_PROCESS;
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel