Hi,

I've attached a patch to fix the above. Not quite sure how to do a proper inline patch for reviewing via gmane newsgroups... will investigate that sometime.

This should go on master and 1.6 IMO (some distros Mandriva included) are using -Werror=format-security by default now.

Col

--

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mandriva Linux Contributor [http://www.mandriva.com/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]
>From 0656e63603a17747777f96c1d587b5e2f1169f30 Mon Sep 17 00:00:00 2001
From: Colin Guthrie <[email protected]>
Date: Tue, 16 Dec 2008 21:57:11 +0000
Subject: [PATCH] Fix compilation with -Werror=format-security and cleanup leaky err (credit to pcpa)

---
 os/log.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/os/log.c b/os/log.c
index 351090c..b01965a 100644
--- a/os/log.c
+++ b/os/log.c
@@ -572,9 +572,10 @@ Error(char *str)
 	    return;
 	sprintf(err, "%s: ", str);
 	strcat(err, strerror(saveErrno));
-	LogWrite(-1, err);
+	LogWrite(-1, "%s", err);
+	free(err);
     } else
-	LogWrite(-1, strerror(saveErrno));
+	LogWrite(-1, "%s", strerror(saveErrno));
 }
 
 void
-- 
1.6.0.4

_______________________________________________
xorg mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/xorg

Reply via email to