summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2011-02-02 23:21:02 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2011-02-04 22:28:39 -0800
commitb1eaa18835ec7c3a11e580340625b35c18edf7ca (patch)
treeac1caee8f0ba532426ef5c94cab3c05d2062b4a5 /src
parent21c1cc98d8210a3ce2a4bf62ecee9168fdd99dcb (diff)
GetResources: protect against underflow when type conversion fails
Fix originally created by Leo Binchy for Sun to fix Solaris bug 1211553: XtVaCreateManagedWidget with list of resources XtVaTypedArg cause core dump Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'src')
-rw-r--r--src/Resources.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Resources.c b/src/Resources.c
index 304d3d5..dc0f563 100644
--- a/src/Resources.c
+++ b/src/Resources.c
@@ -857,7 +857,7 @@ static XtCacheRef *GetResources(
register XtTypedArg* arg = typed_args + typed[j] - 1;
register int i;
- for (i = num_typed_args - typed[j]; i; i--, arg++) {
+ for (i = num_typed_args - typed[j]; i > 0; i--, arg++) {
*arg = *(arg+1);
}
num_typed_args--;