libXau/U_0002-XauFileName-always-go-through-buf-allocation-if-buf-.patch
Stefan Dirsch b16c7a93ba - U_0001-XauFileName-reset-bsize-when-malloc-failed.patch/
U_0002-XauFileName-always-go-through-buf-allocation-if-buf-.patch
  * fixes regression in libXau 1.0.8, which resulted in a crash in
    Mozilla (bnc#831620,fdo#69929)

OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/libXau?expand=0&rev=10
2013-09-30 10:20:19 +00:00

28 lines
747 B
Diff

From 304a11be4727c5a7feeb2501e8e001466f8ce84e Mon Sep 17 00:00:00 2001
From: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sun, 29 Sep 2013 09:23:45 -0700
Subject: [PATCH 2/2] XauFileName: always go through buf allocation if buf is
NULL
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
---
AuFileName.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/AuFileName.c b/AuFileName.c
index 63d4956..7cedfcc 100644
--- a/AuFileName.c
+++ b/AuFileName.c
@@ -66,7 +66,7 @@ XauFileName (void)
return NULL;
}
size = strlen (name) + strlen(&slashDotXauthority[1]) + 2;
- if (size > bsize) {
+ if ((size > bsize) || (buf == NULL)) {
if (buf)
free (buf);
buf = malloc (size);
--
1.8.1.4