Module Name:    xsrc
Committed By:   mrg
Date:           Sat Jul 10 23:28:58 UTC 2021

Modified Files:
        xsrc/external/mit/libX11/dist/src: Font.c FontNames.c SetFPath.c
Removed Files:
        xsrc/external/mit/libX11/dist/m4: libtool.m4 ltoptions.m4 ltsugar.m4
            ltversion.m4 lt~obsolete.m4
        xsrc/external/mit/libXfixes/dist: README

Log Message:
merge libX11 1.7.2, and libXfixes 6.0.0.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r0 xsrc/external/mit/libX11/dist/m4/libtool.m4
cvs rdiff -u -r1.4 -r0 xsrc/external/mit/libX11/dist/m4/ltoptions.m4 \
    xsrc/external/mit/libX11/dist/m4/ltsugar.m4 \
    xsrc/external/mit/libX11/dist/m4/ltversion.m4 \
    xsrc/external/mit/libX11/dist/m4/lt~obsolete.m4
cvs rdiff -u -r1.8 -r1.9 xsrc/external/mit/libX11/dist/src/Font.c
cvs rdiff -u -r1.10 -r1.11 xsrc/external/mit/libX11/dist/src/FontNames.c
cvs rdiff -u -r1.2 -r1.3 xsrc/external/mit/libX11/dist/src/SetFPath.c
cvs rdiff -u -r1.1.1.2 -r0 xsrc/external/mit/libXfixes/dist/README

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.8 xsrc/external/mit/libX11/dist/src/Font.c:1.9
--- xsrc/external/mit/libX11/dist/src/Font.c:1.8	Wed May 19 08:20:08 2021
+++ xsrc/external/mit/libX11/dist/src/Font.c	Sat Jul 10 23:28:58 2021
@@ -102,7 +102,7 @@ XFontStruct *XLoadQueryFont(
     XF86BigfontCodes *extcodes = _XF86BigfontCodes(dpy);
 #endif
 
-    if (strlen(name) >= USHRT_MAX)
+    if (name != NULL && strlen(name) >= USHRT_MAX)
         return NULL;
     if (_XF86LoadQueryLocaleFont(dpy, name, &font_result, (Font *)0))
       return font_result;
@@ -656,7 +656,7 @@ int _XF86LoadQueryLocaleFont(
    XFontStruct **xfp,
    Font *fidp)
 {
-    int l;
+    size_t l;
     const char *charset, *p;
     char buf[256];
     XFontStruct *fs;
@@ -664,7 +664,7 @@ int _XF86LoadQueryLocaleFont(
 
     if (!name)
 	return 0;
-    l = (int) strlen(name);
+    l = strlen(name);
     if (l < 2 || name[l - 1] != '*' || name[l - 2] != '-' || l >= USHRT_MAX)
 	return 0;
     charset = NULL;
@@ -677,11 +677,11 @@ int _XF86LoadQueryLocaleFont(
 	charset = "ISO8859-1";
 	p = charset + 7;
     }
-    if (l - 2 - (p - charset) < 0)
+    if (l - 2 < p - charset)
 	return 0;
     if (_XlcNCompareISOLatin1(name + l - 2 - (p - charset), charset, p - charset))
 	return 0;
-    if (strlen(p + 1) + (size_t) l - 1 >= sizeof(buf) - 1)
+    if (strlen(p + 1) + l - 1 >= sizeof(buf) - 1)
 	return 0;
     strcpy(buf, name);
     strcpy(buf + l - 1, p + 1);

Index: xsrc/external/mit/libX11/dist/src/FontNames.c
diff -u xsrc/external/mit/libX11/dist/src/FontNames.c:1.10 xsrc/external/mit/libX11/dist/src/FontNames.c:1.11
--- xsrc/external/mit/libX11/dist/src/FontNames.c:1.10	Wed May 19 08:20:08 2021
+++ xsrc/external/mit/libX11/dist/src/FontNames.c	Sat Jul 10 23:28:58 2021
@@ -51,7 +51,7 @@ int *actualCount)	/* RETURN */
     register xListFontsReq *req;
     unsigned long rlen = 0;
 
-    if (strlen(pattern) >= USHRT_MAX)
+    if (pattern != NULL && strlen(pattern) >= USHRT_MAX)
         return NULL;
 
     LockDisplay(dpy);

Index: xsrc/external/mit/libX11/dist/src/SetFPath.c
diff -u xsrc/external/mit/libX11/dist/src/SetFPath.c:1.2 xsrc/external/mit/libX11/dist/src/SetFPath.c:1.3
--- xsrc/external/mit/libX11/dist/src/SetFPath.c:1.2	Wed May 19 08:28:15 2021
+++ xsrc/external/mit/libX11/dist/src/SetFPath.c	Sat Jul 10 23:28:58 2021
@@ -38,7 +38,7 @@ XSetFontPath (
     char **directories,
     int ndirs)
 {
-	register int n = 0;
+	register size_t n = 0;
 	register int i;
 	register int nbytes;
 	char *p;
@@ -49,7 +49,7 @@ XSetFontPath (
 	GetReq (SetFontPath, req);
 	req->nFonts = ndirs;
 	for (i = 0; i < ndirs; i++) {
-		n = (int) ((size_t) n + (safestrlen (directories[i]) + 1));
+		n = n + (safestrlen (directories[i]) + 1);
 		if (n >= USHRT_MAX) {
 			UnlockDisplay(dpy);
 			SyncHandle();
@@ -65,9 +65,9 @@ XSetFontPath (
 		char	*tmp = p;
 
 		for (i = 0; i < ndirs; i++) {
-			register int length = (int) safestrlen (directories[i]);
+			size_t length = safestrlen (directories[i]);
 			*p = length;
-			memcpy (p + 1, directories[i], (size_t)length);
+			memcpy (p + 1, directories[i], length);
 			p += length + 1;
 		}
 		Data (dpy, tmp, nbytes);

Reply via email to