Imported Debian patch 2:1.15.1-0ubuntu2.6
[deb_xorg-server.git] / debian / patches / 122_xext_fix_card32_overflow_in_xauth.patch
CommitLineData
7217e0ca
ML
1diff --git a/Xext/security.c b/Xext/security.c
2index 3699510..5e5a703 100644
3--- a/Xext/security.c
4+++ b/Xext/security.c
5@@ -260,9 +260,9 @@ SecurityComputeAuthorizationTimeout(SecurityAuthorizationPtr pAuth,
6 /* maxSecs is the number of full seconds that can be expressed in
7 * 32 bits worth of milliseconds
8 */
9- CARD32 maxSecs = (CARD32) (~0) / (CARD32) MILLI_PER_SECOND;
10+ CARD32 maxSecs = (CARD32) (MAXINT) / (CARD32) MILLI_PER_SECOND;
11
12- if (seconds > maxSecs) { /* only come here if we want to wait more than 49 days */
13+ if (seconds > maxSecs) { /* only come here if we want to wait more than 24 days */
14 pAuth->secondsRemaining = seconds - maxSecs;
15 return maxSecs * MILLI_PER_SECOND;
16 }
17@@ -296,8 +296,6 @@ SecurityAuthorizationExpired(OsTimerPtr timer, CARD32 time, pointer pval)
18 {
19 SecurityAuthorizationPtr pAuth = (SecurityAuthorizationPtr) pval;
20
21- assert(pAuth->timer == timer);
22-
23 if (pAuth->secondsRemaining) {
24 return SecurityComputeAuthorizationTimeout(pAuth,
25 pAuth->secondsRemaining);