Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[xsrc/trunk]: xsrc/external/mit merge xcmsdb 1.0.6, xconsole 1.0.8, xmodmap 1...
details: https://anonhg.NetBSD.org/xsrc/rev/104a50555386
branches: trunk
changeset: 7026:104a50555386
user: mrg <mrg%NetBSD.org@localhost>
date: Mon Jul 11 08:49:36 2022 +0000
description:
merge xcmsdb 1.0.6, xconsole 1.0.8, xmodmap 1.0.11, and xwud 1.0.6.
diffstat:
external/mit/xcmsdb/dist/README | 28 --------------------
external/mit/xconsole/dist/README | 26 -------------------
external/mit/xconsole/dist/xconsole.c | 22 +++++----------
external/mit/xmodmap/dist/handle.c | 47 +++++++++++++++++++++++++++++-----
external/mit/xwud/dist/README | 26 -------------------
5 files changed, 48 insertions(+), 101 deletions(-)
diffs (275 lines):
diff -r 9ab4b3805bd5 -r 104a50555386 external/mit/xcmsdb/dist/README
--- a/external/mit/xcmsdb/dist/README Mon Jul 11 08:48:06 2022 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-xcmsdb is used to load, query, or remove Device Color Characterization
-data stored in properties on the root window of the screen as
-specified in section 7, Device Color Characterization, of the
-X11 Inter-Client Communication Conventions Manual (ICCCM).
-
-All questions regarding this software should be directed at the
-Xorg mailing list:
-
- http://lists.freedesktop.org/mailman/listinfo/xorg
-
-Please submit bug reports to the Xorg bugzilla:
-
- https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
-
-The master development code repository can be found at:
-
- git://anongit.freedesktop.org/git/xorg/app/xcmsdb
-
- http://cgit.freedesktop.org/xorg/app/xcmsdb
-
-For patch submission instructions, see:
-
- http://www.x.org/wiki/Development/Documentation/SubmittingPatches
-
-For more information on the git code manager, see:
-
- http://wiki.x.org/wiki/GitPage
-
diff -r 9ab4b3805bd5 -r 104a50555386 external/mit/xconsole/dist/README
--- a/external/mit/xconsole/dist/README Mon Jul 11 08:48:06 2022 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-xconsole displays in a X11 window the messages which are usually sent
-to /dev/console
-
-All questions regarding this software should be directed at the
-Xorg mailing list:
-
- http://lists.freedesktop.org/mailman/listinfo/xorg
-
-Please submit bug reports to the Xorg bugzilla:
-
- https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
-
-The master development code repository can be found at:
-
- git://anongit.freedesktop.org/git/xorg/app/xconsole
-
- http://cgit.freedesktop.org/xorg/app/xconsole
-
-For patch submission instructions, see:
-
- http://www.x.org/wiki/Development/Documentation/SubmittingPatches
-
-For more information on the git code manager, see:
-
- http://wiki.x.org/wiki/GitPage
-
diff -r 9ab4b3805bd5 -r 104a50555386 external/mit/xconsole/dist/xconsole.c
--- a/external/mit/xconsole/dist/xconsole.c Mon Jul 11 08:48:06 2022 +0000
+++ b/external/mit/xconsole/dist/xconsole.c Mon Jul 11 08:49:36 2022 +0000
@@ -178,7 +178,6 @@
# if defined(TIOCCONS) || defined(SRIOCSREDIR)
# define USE_PTY
static int tty_fd, pty_fd;
-static char ttydev[64], ptydev[64];
# endif
#endif
@@ -188,7 +187,7 @@
#endif
#ifdef USE_PTY
-static int get_pty(int *pty, int *tty, char *ttydev, char *ptydev);
+static int get_pty(int *pty, int *tty);
#endif
#ifdef USE_OSM
@@ -243,7 +242,7 @@
#endif
#ifdef USE_PTY
- if (!input && get_pty (&pty_fd, &tty_fd, ttydev, ptydev) == 0)
+ if (!input && get_pty (&pty_fd, &tty_fd) == 0)
{
# ifdef TIOCCONS
int on = 1;
@@ -789,14 +788,17 @@
*/
static int
-get_pty(int *pty, int *tty, char *ttydev, char *ptydev)
+get_pty(int *pty, int *tty)
{
#ifdef HAS_OPENPTY
if (openpty(pty, tty, NULL, NULL, NULL) == -1) {
return 1;
}
return 0;
-#elif defined (SVR4) || defined (USE_PTS)
+#else
+ static char ttydev[64], ptydev[64];
+
+#if defined (SVR4) || defined (USE_PTS)
#if defined (_AIX)
if ((*pty = open ("/dev/ptc", O_RDWR)) < 0)
#else
@@ -823,14 +825,6 @@
#else
static int devindex, letter = 0;
-#ifdef sgi
- {
- char *slave;
- slave = _getpty (pty, O_RDWR, 0622, 0);
- if ((*tty = open (slave, O_RDWR)) != -1)
- return 0;
- }
-#else
strcpy (ttydev, "/dev/ttyxx");
strcpy (ptydev, "/dev/ptyxx");
while (PTYCHAR1[letter]) {
@@ -857,7 +851,6 @@
devindex = 0;
(void) letter++;
}
-#endif /* sgi else not sgi */
#endif /* USE_GET_PSEUDOTTY */
#endif /* SVR4 */
/*
@@ -865,6 +858,7 @@
* condition and let our caller terminate cleanly.
*/
return(1);
+#endif /* HAS_OPENPTY */
}
#endif
diff -r 9ab4b3805bd5 -r 104a50555386 external/mit/xmodmap/dist/handle.c
--- a/external/mit/xmodmap/dist/handle.c Mon Jul 11 08:48:06 2022 +0000
+++ b/external/mit/xmodmap/dist/handle.c Mon Jul 11 08:49:36 2022 +0000
@@ -37,6 +37,7 @@
#include "xmodmap.h"
#include "wq.h"
#include <stdlib.h>
+#include <stdint.h>
#ifdef HAVE_STRNCASECMP
#include <strings.h>
@@ -59,6 +60,26 @@
* common utility routines
*/
+/*
+ * This is a combination of reallocf() and reallocarray().
+ * If the realloc fails, it frees the old pointer so it doesn't leak.
+ */
+static void *
+reallocfarray(void *old, size_t num, size_t size)
+{
+ static void *new;
+
+ if (size > 0 && num > (SIZE_MAX / size)) /* overflow would happen */
+ new = NULL;
+ else
+ new = realloc(old, num * size);
+
+ if (new == NULL)
+ free(old);
+
+ return new;
+}
+
static KeyCode *
KeysymToKeycodes(Display *dpy, KeySym keysym, int *pnum_kcs)
{
@@ -72,7 +93,12 @@
if (!kcs)
kcs = malloc(sizeof(KeyCode));
else
- kcs = realloc(kcs, sizeof(KeyCode) * (*pnum_kcs + 1));
+ kcs = reallocfarray(kcs, (*pnum_kcs + 1), sizeof(KeyCode));
+ if (!kcs) {
+ fprintf(stderr, "attempt to allocate %ld byte keycode set",
+ (long) ((*pnum_kcs + 1) * sizeof (KeyCode)));
+ return NULL;
+ }
kcs[*pnum_kcs] = i;
*pnum_kcs += 1;
break;
@@ -690,7 +716,7 @@
}
if (nc + num_kcs > tot) {
tot = nc + num_kcs;
- kclist = realloc(kclist, tot * sizeof(KeyCode));
+ kclist = reallocfarray(kclist, tot, sizeof(KeyCode));
if (!kclist) {
badmsg ("attempt to allocate %ld byte keycode list",
(long) (tot * sizeof (KeyCode)));
@@ -708,6 +734,7 @@
if (!uop) {
badmsg ("attempt to allocate %ld byte removemodifier opcode",
(long) sizeof (struct op_removemodifier));
+ free(kclist);
return;
}
oprm = &uop->removemodifier;
@@ -889,8 +916,16 @@
}
if (i > 0 && i != nbuttons) {
- fprintf (stderr, "Warning: Only changing the first %d of %d buttons.\n",
- i, nbuttons);
+ if (i < nbuttons) {
+ fprintf (stderr,
+ "Warning: Only changing the first %d of %d buttons.\n",
+ i, nbuttons);
+ }
+ else { /* i > nbuttons */
+ fprintf (stderr,
+ "Warning: Not changing %d extra buttons beyond %d.\n",
+ i - nbuttons, nbuttons);
+ }
i = nbuttons;
}
@@ -974,13 +1009,11 @@
/* grow the list bigger if necessary */
if (havesofar >= maxcanhave) {
- KeySym *origkeysymlist = keysymlist;
maxcanhave *= 2;
- keysymlist = realloc (keysymlist, maxcanhave * sizeof (KeySym));
+ keysymlist = reallocfarray(keysymlist, maxcanhave, sizeof(KeySym));
if (!keysymlist) {
badmsg ("attempt to grow keysym list to %ld bytes",
(long) (maxcanhave * sizeof (KeySym)));
- free(origkeysymlist);
return (-1);
}
}
diff -r 9ab4b3805bd5 -r 104a50555386 external/mit/xwud/dist/README
--- a/external/mit/xwud/dist/README Mon Jul 11 08:48:06 2022 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-xwud allows X users to display in a window an image saved in a
-specially formatted dump file, such as produced by xwd.
-
-All questions regarding this software should be directed at the
-Xorg mailing list:
-
- http://lists.freedesktop.org/mailman/listinfo/xorg
-
-Please submit bug reports to the Xorg bugzilla:
-
- https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
-
-The master development code repository can be found at:
-
- git://anongit.freedesktop.org/git/xorg/app/xwud
-
- http://cgit.freedesktop.org/xorg/app/xwud
-
-For patch submission instructions, see:
-
- http://www.x.org/wiki/Development/Documentation/SubmittingPatches
-
-For more information on the git code manager, see:
-
- http://wiki.x.org/wiki/GitPage
-
Home |
Main Index |
Thread Index |
Old Index