[PATCH] doPolyText: forget about FontChange's XID after looking up pFont.
As of e2929db7b737413cf93fbebdf4d15abdfebff05c, doPolyText uses pFont consistently rather than looking it up again from the saved XID. clang noticed that fid = oldfid could run when oldfid hadn't been initialized yet. Signed-off-by: Jamey Sharp ja...@minilop.net --- dix/dixfonts.c |6 ++ 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/dix/dixfonts.c b/dix/dixfonts.c index ba1d0e2..b6d54f8 100644 --- a/dix/dixfonts.c +++ b/dix/dixfonts.c @@ -1173,7 +1173,6 @@ int doPolyText(ClientPtr client, PTclosurePtr c) { FontPtr pFont = c-pGC-font, oldpFont; -Font fid, oldfid; int err = Success, lgerr; /* err is in X error, not font error, space */ enum { NEVER_SLEPT, START_SLEEP, SLEEPING } client_state = NEVER_SLEPT; FontPathElementPtr fpe; @@ -1221,6 +1220,7 @@ doPolyText(ClientPtr client, PTclosurePtr c) { if (*c-pElt == FontChange) { + Font fid; if (c-endReq - c-pElt FontShiftSize) { err = BadLength; @@ -1228,7 +1228,6 @@ doPolyText(ClientPtr client, PTclosurePtr c) } oldpFont = pFont; - oldfid = fid; fid = ((Font)*(c-pElt+4)) /* big-endian */ | ((Font)*(c-pElt+3)) 8 @@ -1238,9 +1237,8 @@ doPolyText(ClientPtr client, PTclosurePtr c) client, DixUseAccess); if (err != Success) { - /* restore pFont and fid for step 4 (described below) */ + /* restore pFont for step 4 (described below) */ pFont = oldpFont; - fid = oldfid; /* If we're in START_SLEEP mode, the following step shortens the request... in the unlikely event that -- 1.7.0 ___ 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] doPolyText: forget about FontChange's XID after looking up pFont.
As of e2929db7b737413cf93fbebdf4d15abdfebff05c, doPolyText uses pFont consistently rather than looking it up again from the saved XID. clang noticed that oldfid = fid could run when fid hadn't been initialized yet. Signed-off-by: Jamey Sharp ja...@minilop.net --- Same patch, with a commit message that isn't wrong this time. dix/dixfonts.c |6 ++ 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/dix/dixfonts.c b/dix/dixfonts.c index ba1d0e2..b6d54f8 100644 --- a/dix/dixfonts.c +++ b/dix/dixfonts.c @@ -1173,7 +1173,6 @@ int doPolyText(ClientPtr client, PTclosurePtr c) { FontPtr pFont = c-pGC-font, oldpFont; -Font fid, oldfid; int err = Success, lgerr; /* err is in X error, not font error, space */ enum { NEVER_SLEPT, START_SLEEP, SLEEPING } client_state = NEVER_SLEPT; FontPathElementPtr fpe; @@ -1221,6 +1220,7 @@ doPolyText(ClientPtr client, PTclosurePtr c) { if (*c-pElt == FontChange) { + Font fid; if (c-endReq - c-pElt FontShiftSize) { err = BadLength; @@ -1228,7 +1228,6 @@ doPolyText(ClientPtr client, PTclosurePtr c) } oldpFont = pFont; - oldfid = fid; fid = ((Font)*(c-pElt+4)) /* big-endian */ | ((Font)*(c-pElt+3)) 8 @@ -1238,9 +1237,8 @@ doPolyText(ClientPtr client, PTclosurePtr c) client, DixUseAccess); if (err != Success) { - /* restore pFont and fid for step 4 (described below) */ + /* restore pFont for step 4 (described below) */ pFont = oldpFont; - fid = oldfid; /* If we're in START_SLEEP mode, the following step shortens the request... in the unlikely event that -- 1.7.0 ___ 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] doPolyText: forget about FontChange's XID after looking up pFont.
Reviewed-by: Jeremy Huddleston jerem...@apple.com Tested-by: Jeremy Huddleston jerem...@apple.com On May 21, 2010, at 11:12, Jamey Sharp wrote: As of e2929db7b737413cf93fbebdf4d15abdfebff05c, doPolyText uses pFont consistently rather than looking it up again from the saved XID. clang noticed that oldfid = fid could run when fid hadn't been initialized yet. Signed-off-by: Jamey Sharp ja...@minilop.net --- Same patch, with a commit message that isn't wrong this time. dix/dixfonts.c |6 ++ 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/dix/dixfonts.c b/dix/dixfonts.c index ba1d0e2..b6d54f8 100644 --- a/dix/dixfonts.c +++ b/dix/dixfonts.c @@ -1173,7 +1173,6 @@ int doPolyText(ClientPtr client, PTclosurePtr c) { FontPtr pFont = c-pGC-font, oldpFont; -Font fid, oldfid; int err = Success, lgerr; /* err is in X error, not font error, space */ enum { NEVER_SLEPT, START_SLEEP, SLEEPING } client_state = NEVER_SLEPT; FontPathElementPtr fpe; @@ -1221,6 +1220,7 @@ doPolyText(ClientPtr client, PTclosurePtr c) { if (*c-pElt == FontChange) { + Font fid; if (c-endReq - c-pElt FontShiftSize) { err = BadLength; @@ -1228,7 +1228,6 @@ doPolyText(ClientPtr client, PTclosurePtr c) } oldpFont = pFont; - oldfid = fid; fid = ((Font)*(c-pElt+4)) /* big-endian */ | ((Font)*(c-pElt+3)) 8 @@ -1238,9 +1237,8 @@ doPolyText(ClientPtr client, PTclosurePtr c) client, DixUseAccess); if (err != Success) { - /* restore pFont and fid for step 4 (described below) */ + /* restore pFont for step 4 (described below) */ pFont = oldpFont; - fid = oldfid; /* If we're in START_SLEEP mode, the following step shortens the request... in the unlikely event that -- 1.7.0 ___ 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 ___ 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