Module Name:    xsrc
Committed By:   mrg
Date:           Fri Nov 15 07:16:42 UTC 2024

Modified Files:
        xsrc/external/mit/libFS/dist/src: FSlibInt.c
        xsrc/external/mit/libXcursor/include: config.h
        xsrc/external/mit/libXi/dist/man: XGetDeviceKeyMapping.man
        xsrc/external/mit/libXi/dist/src: XGetFCtl.c XIQueryDevice.c
        xsrc/external/mit/libXtst/dist/src: XRecord.c

Log Message:
merge libXcursor 1.2.3, libXi 1.8.2, libFS 1.0.10, libXfont2 2.0.7, and
libXtst 1.2.5.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 xsrc/external/mit/libFS/dist/src/FSlibInt.c
cvs rdiff -u -r1.6 -r1.7 xsrc/external/mit/libXcursor/include/config.h
cvs rdiff -u -r1.3 -r1.4 \
    xsrc/external/mit/libXi/dist/man/XGetDeviceKeyMapping.man
cvs rdiff -u -r1.6 -r1.7 xsrc/external/mit/libXi/dist/src/XGetFCtl.c
cvs rdiff -u -r1.3 -r1.4 xsrc/external/mit/libXi/dist/src/XIQueryDevice.c
cvs rdiff -u -r1.8 -r1.9 xsrc/external/mit/libXtst/dist/src/XRecord.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/libFS/dist/src/FSlibInt.c
diff -u xsrc/external/mit/libFS/dist/src/FSlibInt.c:1.5 xsrc/external/mit/libFS/dist/src/FSlibInt.c:1.6
--- xsrc/external/mit/libFS/dist/src/FSlibInt.c:1.5	Sun Jul 19 05:52:53 2015
+++ xsrc/external/mit/libFS/dist/src/FSlibInt.c	Fri Nov 15 07:16:41 2024
@@ -87,11 +87,7 @@ static const char * _SysErrorMsg ( int n
 #define ECHECK(err) (WSAGetLastError() == err)
 #define ESET(val) WSASetLastError(val)
 #else
-#ifdef ISC
-#define ECHECK(err) ((errno == err) || ETEST())
-#else
 #define ECHECK(err) (errno == err)
-#endif
 #define ESET(val) errno = val
 #endif
 
@@ -155,11 +151,6 @@ _FSFlush(register FSServer *svr)
 	    bufindex += write_stat;
 	} else if (ETEST()) {
 	    _FSWaitForWritable(svr);
-#ifdef SUNSYSV
-	} else if (ECHECK(0)) {
-	    _FSWaitForWritable(svr);
-#endif
-
 #ifdef EMSGSIZE
 	} else if (ECHECK(EMSGSIZE)) {
 	    if (todo > 1)
@@ -243,9 +234,6 @@ _FSRead(
     register long	 size)
 {
     register long bytes_read;
-#if defined(SVR4) && defined(i386)
-    int	num_failed_reads = 0;
-#endif
 
     if (size == 0)
 	return;
@@ -261,27 +249,11 @@ _FSRead(
 	if (bytes_read > 0) {
 	    size -= bytes_read;
 	    data += bytes_read;
-#if defined(SVR4) && defined(i386)
-	    num_failed_reads = 0;
-#endif
 	}
 	else if (ETEST()) {
 	    _FSWaitForReadable(svr);
-#if defined(SVR4) && defined(i386)
-	    num_failed_reads++;
-	    if (num_failed_reads > 1) {
-		ESET(EPIPE);
-		(*_FSIOErrorFunction) (svr);
-	    }
-#endif
 	    ESET(0);
 	}
-#ifdef SUNSYSV
-	else if (ECHECK(0)) {
-	    _FSWaitForReadable(svr);
-	}
-#endif
-
 	else if (bytes_read == 0) {
 	    /* Read failed because of end of file! */
 	    ESET(EPIPE);
@@ -290,10 +262,6 @@ _FSRead(
 	    /* If it's a system call interrupt, it's not an error. */
 	    if (!ECHECK(EINTR))
 		(*_FSIOErrorFunction) (svr);
-#if defined(SVR4) && defined(i386)
-	    else
-		num_failed_reads = 0;
-#endif
 	}
     }
 }
@@ -347,12 +315,6 @@ _FSReadPad(
 	    _FSWaitForReadable(svr);
 	    ESET(0);
 	}
-#ifdef SUNSYSV
-	else if (ECHECK(0)) {
-	    _FSWaitForReadable(svr);
-	}
-#endif
-
 	else if (bytes_read == 0) {
 	    /* Read failed because of end of file! */
 	    ESET(EPIPE);
@@ -438,11 +400,6 @@ _FSSend(
 	    todo = total;
 	} else if (ETEST()) {
 		_FSWaitForWritable(svr);
-#ifdef SUNSYSV
-	} else if (ECHECK(0)) {
-	    _FSWaitForWritable(svr);
-#endif
-
 #ifdef EMSGSIZE
 	} else if (ECHECK(EMSGSIZE)) {
 	    if (todo > 1)

Index: xsrc/external/mit/libXcursor/include/config.h
diff -u xsrc/external/mit/libXcursor/include/config.h:1.6 xsrc/external/mit/libXcursor/include/config.h:1.7
--- xsrc/external/mit/libXcursor/include/config.h:1.6	Tue Jul 12 01:26:29 2022
+++ xsrc/external/mit/libXcursor/include/config.h	Fri Nov 15 07:16:41 2024
@@ -48,7 +48,7 @@
 #define PACKAGE_NAME "libXcursor"
 
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING "libXcursor 1.2.1"
+#define PACKAGE_STRING "libXcursor 1.2.3"
 
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME "libXcursor"
@@ -57,7 +57,7 @@
 #define PACKAGE_URL ""
 
 /* Define to the version of this package. */
-#define PACKAGE_VERSION "1.2.1"
+#define PACKAGE_VERSION "1.2.3"
 
 /* Major version of this package */
 #define PACKAGE_VERSION_MAJOR 1
@@ -66,7 +66,7 @@
 #define PACKAGE_VERSION_MINOR 2
 
 /* Patch version of this package */
-#define PACKAGE_VERSION_PATCHLEVEL 1
+#define PACKAGE_VERSION_PATCHLEVEL 3
 
 /* Define to 1 if all of the C90 standard headers exist (not just the ones
    required in a freestanding environment). This macro is provided for
@@ -74,4 +74,4 @@
 #define STDC_HEADERS 1
 
 /* Version number of package */
-#define VERSION "1.2.1"
+#define VERSION "1.2.3"

Index: xsrc/external/mit/libXi/dist/man/XGetDeviceKeyMapping.man
diff -u xsrc/external/mit/libXi/dist/man/XGetDeviceKeyMapping.man:1.3 xsrc/external/mit/libXi/dist/man/XGetDeviceKeyMapping.man:1.4
--- xsrc/external/mit/libXi/dist/man/XGetDeviceKeyMapping.man:1.3	Mon Jun 19 06:44:23 2023
+++ xsrc/external/mit/libXi/dist/man/XGetDeviceKeyMapping.man	Fri Nov 15 07:16:41 2024
@@ -2,12 +2,12 @@
 .\"     Title: xgetdevicekeymapping
 .\"    Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
-.\"      Date: 05/04/2023
+.\"      Date: 09/05/2024
 .\"    Manual: \ \&
 .\"    Source: \ \&
 .\"  Language: English
 .\"
-.TH "XGETDEVICEKEYMAPPING" "libmansuffix" "05/04/2023" "\ \&" "\ \&"
+.TH "XGETDEVICEKEYMAPPING" "libmansuffix" "09/05/2024" "\ \&" "\ \&"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------

Index: xsrc/external/mit/libXi/dist/src/XGetFCtl.c
diff -u xsrc/external/mit/libXi/dist/src/XGetFCtl.c:1.6 xsrc/external/mit/libXi/dist/src/XGetFCtl.c:1.7
--- xsrc/external/mit/libXi/dist/src/XGetFCtl.c:1.6	Tue Oct  4 22:01:49 2016
+++ xsrc/external/mit/libXi/dist/src/XGetFCtl.c	Fri Nov 15 07:16:42 2024
@@ -67,7 +67,7 @@ XFeedbackState *
 XGetFeedbackControl(
     register Display	*dpy,
     XDevice		*dev,
-    int			*num_feedbacks)
+    int			*num_feedbacks_out)
 {
     XFeedbackState *Feedback = NULL;
     XFeedbackState *Sav = NULL;
@@ -77,6 +77,8 @@ XGetFeedbackControl(
     xGetFeedbackControlReq *req;
     xGetFeedbackControlReply rep;
     XExtDisplayInfo *info = XInput_find_display(dpy);
+    int num_feedbacks = 0;
+    int known_feedbacks = 0;
 
     LockDisplay(dpy);
     if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1)
@@ -95,7 +97,7 @@ XGetFeedbackControl(
 	size_t size = 0;
 	int i;
 
-	*num_feedbacks = rep.num_feedbacks;
+	num_feedbacks = rep.num_feedbacks;
 
 	if (rep.length < (INT_MAX >> 2)) {
 	    nbytes = rep.length << 2;
@@ -109,7 +111,7 @@ XGetFeedbackControl(
 	end = (char *)f + nbytes;
 	_XRead(dpy, (char *)f, nbytes);
 
-	for (i = 0; i < *num_feedbacks; i++) {
+	for (i = 0; i < num_feedbacks; i++) {
 	    if ((char *)f + sizeof(*f) > end ||
 	        f->length == 0 || f->length > nbytes)
 		goto out;
@@ -141,7 +143,7 @@ XGetFeedbackControl(
 		size += sizeof(XBellFeedbackState);
 		break;
 	    default:
-		size += f->length;
+		/* unknown classes are skipped */
 		break;
 	    }
 	    if (size > INT_MAX)
@@ -154,9 +156,11 @@ XGetFeedbackControl(
 	    goto out;
 
 	Sav = Feedback;
+	known_feedbacks = num_feedbacks;
 
 	f = sav;
-	for (i = 0; i < *num_feedbacks; i++) {
+	for (i = 0; i < num_feedbacks; i++) {
+	    Bool skip = False;
 	    switch (f->class) {
 	    case KbdFeedbackClass:
 	    {
@@ -262,14 +266,18 @@ XGetFeedbackControl(
 		break;
 	    }
 	    default:
+		--known_feedbacks;
+		skip = True;
 		break;
 	    }
 	    f = (xFeedbackState *) ((char *)f + f->length);
-	    Feedback = (XFeedbackState *) ((char *)Feedback + Feedback->length);
+	    if (!skip)
+		Feedback = (XFeedbackState *) ((char *)Feedback + Feedback->length);
 	}
     }
 out:
     XFree((char *)sav);
+    *num_feedbacks_out = known_feedbacks;
 
     UnlockDisplay(dpy);
     SyncHandle();

Index: xsrc/external/mit/libXi/dist/src/XIQueryDevice.c
diff -u xsrc/external/mit/libXi/dist/src/XIQueryDevice.c:1.3 xsrc/external/mit/libXi/dist/src/XIQueryDevice.c:1.4
--- xsrc/external/mit/libXi/dist/src/XIQueryDevice.c:1.3	Sat Mar  4 21:48:03 2017
+++ xsrc/external/mit/libXi/dist/src/XIQueryDevice.c	Fri Nov 15 07:16:42 2024
@@ -150,7 +150,7 @@ void
 XIFreeDeviceInfo(XIDeviceInfo* info)
 {
     XIDeviceInfo *ptr = info;
-    while(ptr->name)
+    while(ptr && ptr->name)
     {
         Xfree(ptr->classes);
         Xfree(ptr->name);

Index: xsrc/external/mit/libXtst/dist/src/XRecord.c
diff -u xsrc/external/mit/libXtst/dist/src/XRecord.c:1.8 xsrc/external/mit/libXtst/dist/src/XRecord.c:1.9
--- xsrc/external/mit/libXtst/dist/src/XRecord.c:1.8	Wed Sep 28 02:37:06 2022
+++ xsrc/external/mit/libXtst/dist/src/XRecord.c	Fri Nov 15 07:16:42 2024
@@ -452,10 +452,9 @@ XRecordGetContext(Display *dpy, XRecordC
 	ret->client_info = client_inf;
         if (!client_inf || !client_inf_str)
         {
-	   free(client_inf);
 	   _XEatDataWords (dpy, rep.length);
 	   UnlockDisplay(dpy);
-	   XRecordFreeState(ret);
+	   XRecordFreeState(ret); /* frees ret->client_info, aka client_inf */
 	   SyncHandle();
 	   return 0;
         }
@@ -510,14 +509,14 @@ XRecordGetContext(Display *dpy, XRecordC
 void
 XRecordFreeState(XRecordState *state)
 {
-    for (unsigned long i = 0; i < state->nclients; i++) {
-	if (state->client_info[i]->ranges) {
-	    if (state->client_info[i]->ranges[0])
-		Xfree(state->client_info[i]->ranges[0]);
-	    Xfree(state->client_info[i]->ranges);
-	}
-    }
     if (state->client_info) {
+	for (unsigned long i = 0; i < state->nclients; i++) {
+	    if (state->client_info[i]->ranges) {
+		if (state->client_info[i]->ranges[0])
+		    Xfree(state->client_info[i]->ranges[0]);
+		Xfree(state->client_info[i]->ranges);
+	    }
+	}
 	if (state->client_info[0])
 	    Xfree(state->client_info[0]);
 	Xfree(state->client_info);
@@ -746,6 +745,8 @@ parse_reply_call_callback(
 	 */
 	switch (rep->category) {
 	case XRecordFromServer:
+	    if (reply == NULL)
+		goto out;
 	    if (rep->elementHeader&XRecordFromServerTime) {
 		if (current_index + 4 > rep->length << 2)
 		    return Error;
@@ -771,6 +772,8 @@ parse_reply_call_callback(
 	    }
 	    break;
 	case XRecordFromClient:
+	    if (reply == NULL)
+		goto out;
 	    if (rep->elementHeader&XRecordFromClientTime) {
 		if (current_index + 4 > rep->length << 2)
 		    goto out;
@@ -805,6 +808,8 @@ parse_reply_call_callback(
 	    datum_bytes <<= 2;
 	    break;
 	case XRecordClientStarted:
+	    if (reply == NULL)
+		goto out;
 	    if (current_index + 8 > rep->length << 2)
 		goto out;
 	    EXTRACT_CARD16(rep->clientSwapped,
@@ -813,6 +818,8 @@ parse_reply_call_callback(
 	    break;
 	case XRecordClientDied:
 	    if (rep->elementHeader&XRecordFromClientSequence) {
+		if (reply == NULL)
+		    goto out;
 		if (current_index + 4 > rep->length << 2)
 		    goto out;
 		EXTRACT_CARD32(rep->clientSwapped,

Reply via email to