Module Name:    xsrc
Committed By:   mrg
Date:           Sun Mar  3 07:08:48 UTC 2019

Modified Files:
        xsrc/external/mit/libXau/dist: AuFileName.c
Removed Files:
        xsrc/external/mit/libfontenc/dist: README

Log Message:
merge libXau 1.0.9 and libfontenc 1.1.4.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 xsrc/external/mit/libXau/dist/AuFileName.c
cvs rdiff -u -r1.1.1.2 -r0 xsrc/external/mit/libfontenc/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/libXau/dist/AuFileName.c
diff -u xsrc/external/mit/libXau/dist/AuFileName.c:1.2 xsrc/external/mit/libXau/dist/AuFileName.c:1.3
--- xsrc/external/mit/libXau/dist/AuFileName.c:1.2	Fri Jan  4 18:53:36 2019
+++ xsrc/external/mit/libXau/dist/AuFileName.c	Sun Mar  3 07:08:47 2019
@@ -29,6 +29,7 @@ in this Software without prior written a
 #endif
 #include <X11/Xauth.h>
 #include <X11/Xos.h>
+#include <assert.h>
 #include <stdlib.h>
 
 static char *buf = NULL;
@@ -71,12 +72,14 @@ XauFileName (void)
 	return NULL;
     }
     size = strlen (name) + strlen(&slashDotXauthority[1]) + 2;
-    if (size > bsize) {
-	if (buf)
-	    free (buf);
+    if ((size > bsize) || (buf == NULL)) {
+	free (buf);
+        assert(size > 0);
 	buf = malloc (size);
-	if (!buf)
+	if (!buf) {
+	    bsize = 0;
 	    return NULL;
+	}
 
 #ifndef __NetBSD__
         if (!atexit_registered) {
@@ -88,6 +91,6 @@ XauFileName (void)
 	bsize = size;
     }
     snprintf (buf, bsize, "%s%s", name,
-              slashDotXauthority + (name[1] == '\0' ? 1 : 0));
+              slashDotXauthority + (name[0] == '/' && name[1] == '\0' ? 1 : 0));
     return buf;
 }

Reply via email to