Module Name:    xsrc
Committed By:   wiz
Date:           Tue Jun 25 16:15:16 UTC 2013

Modified Files:
        xsrc/external/mit/libX11/dist/src: Font.c

Log Message:
Fix out-of-range comparison.

clang complained:
warning: comparison of constant 768614336404564650 with expression
of type 'CARD32' (aka 'unsigned int') is always true
[-Wtautological-constant-out-of-range-compare]


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.6 -r1.2 xsrc/external/mit/libX11/dist/src/Font.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/external/mit/libX11/dist/src/Font.c
diff -u xsrc/external/mit/libX11/dist/src/Font.c:1.1.1.6 xsrc/external/mit/libX11/dist/src/Font.c:1.2
--- xsrc/external/mit/libX11/dist/src/Font.c:1.1.1.6	Thu May 30 23:04:40 2013
+++ xsrc/external/mit/libX11/dist/src/Font.c	Tue Jun 25 16:15:16 2013
@@ -588,7 +588,7 @@ _XF86BigfontQueryFont (
 	    if (!(extcodes->serverCapabilities & CAP_VerifiedLocal)) {
 		struct shmid_ds buf;
 		if (!(shmctl(reply.shmid, IPC_STAT, &buf) >= 0
-		      && reply.nCharInfos < (LONG_MAX / sizeof(XCharStruct))
+		      && reply.nCharInfos < (INT_MAX / sizeof(XCharStruct))
 		      && buf.shm_segsz >= reply.shmsegoffset + reply.nCharInfos * sizeof(XCharStruct) + sizeof(CARD32)
 		      && *(CARD32 *)(addr + reply.shmsegoffset + reply.nCharInfos * sizeof(XCharStruct)) == extcodes->serverSignature)) {
 		    shmdt(addr);

Reply via email to