Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 236840 - PATCH: >=app-emulation/wine-1.1.3
Summary: PATCH: >=app-emulation/wine-1.1.3
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Wine Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-06 06:53 UTC by Chris Manigan
Modified: 2008-09-07 11:07 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Manigan 2008-09-06 06:53:21 UTC
From: http://www.nabble.com/0001-Sanity-Check-in-ImmSetCompositionStringA-and-ImmSetC.patch-td18769013.html

[0001-Sanity-Check-in-ImmSetCompositionStringA-and-ImmSetC.patch]
From 6d5387362b9773d5f0e938cf22eae0530973ae43 Mon Sep 17 00:00:00 2001
From: Jason Borden <jborden@...>
Date: Thu, 31 Jul 2008 23:40:24 -0600
Subject: [PATCH] Sanity Check in ImmSetCompositionStringA and ImmSetCompositionStringW

This patch adds an additional sanity check to the dwIndex variable of the
ImmSetCompositionStringA and ImmSetCompostionStringW functions. API
documentation specifies that dwIndex can have one of the following values:
SCS_SETSTR
SCS_CHANGEATTR
SCS_CHANGECLAUSE
SCS_SETRECONVERTSTRING
SCS_QUERYRECONVERTSTRING
Pre patch, if an application executes this function with an invalid dwIndex
value, a recursive loop results (As is the case in Final Fantasy XI).
---
 dlls/imm32/imm.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/dlls/imm32/imm.c b/dlls/imm32/imm.c
index 94b7752..ab08dec 100644
--- a/dlls/imm32/imm.c
+++ b/dlls/imm32/imm.c
@@ -2011,6 +2011,14 @@ BOOL WINAPI ImmSetCompositionStringA(
     TRACE("(%p, %d, %p, %d, %p, %d):\n",
             hIMC, dwIndex, lpComp, dwCompLen, lpRead, dwReadLen);
 
+    if (dwIndex != SCS_SETSTR && dwIndex != SCS_CHANGEATTR && dwIndex !=
+        SCS_CHANGECLAUSE && dwIndex != SCS_SETRECONVERTSTRING && dwIndex !=
+        SCS_QUERYRECONVERTSTRING)
+    {
+        TRACE("Invalid dwIndex parameter specified\n");
+        return FALSE;
+    }
+
     if (!data)
         return FALSE;
 
@@ -2059,6 +2067,14 @@ BOOL WINAPI ImmSetCompositionStringW(
     TRACE("(%p, %d, %p, %d, %p, %d):\n",
             hIMC, dwIndex, lpComp, dwCompLen, lpRead, dwReadLen);
 
+    if (dwIndex != SCS_SETSTR && dwIndex != SCS_CHANGEATTR && dwIndex !=
+        SCS_CHANGECLAUSE && dwIndex != SCS_SETRECONVERTSTRING && dwIndex !=
+        SCS_QUERYRECONVERTSTRING)
+    {
+        TRACE("Invalid dwIndex parameter specified\n");
+        return FALSE;
+    }
+
     if (!data)
         return FALSE;
 
-- 
1.5.3.4

Reproducible: Always

Steps to Reproduce:
1. Play Final Fantasy XI in Wine
Actual Results:  
Low framerates which require an in-game "hack" to correct

Expected Results:  
Decent framerates without the in-game hack.

See also: http://appdb.winehq.org/objectManager.php?sClass=version&iId=2739
Comment 1 Wormo (RETIRED) gentoo-dev 2008-09-06 07:22:47 UTC
Thanks for the reporting the patch, assigning to maintainers
Comment 2 SpanKY gentoo-dev 2008-09-07 06:27:08 UTC
we dont have manpower for wine ... patches get sent upstream and get applied there
Comment 3 Chris Manigan 2008-09-07 11:07:33 UTC
It took me a whole 2 minutes to modify the ebuild to apply the patch right before it compiles.  There is at least one other Wine patch that gets applied the same way.  Can I submit an ebuild and patch file and it gets called "-r1" or something?  This patch was submitted over a month ago to wine devs I believe and still has not made it into a release.