summaryrefslogtreecommitdiff
path: root/testing/util-linux/write-freopen.patch
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2011-09-10 23:14:36 +0000
committerroot <root@rshg054.dnsready.net>2011-09-10 23:14:36 +0000
commit1dc1efa50ce9926a6ed832bda2ebe3319485ac09 (patch)
tree25b059dc89bbd5f44377c1df6f612cf6556a6076 /testing/util-linux/write-freopen.patch
parent42db4a0cf3a829fcd1bc2150669c6aa3c2984815 (diff)
Sat Sep 10 23:14:36 UTC 2011
Diffstat (limited to 'testing/util-linux/write-freopen.patch')
-rw-r--r--testing/util-linux/write-freopen.patch27
1 files changed, 27 insertions, 0 deletions
diff --git a/testing/util-linux/write-freopen.patch b/testing/util-linux/write-freopen.patch
new file mode 100644
index 000000000..a2014a107
--- /dev/null
+++ b/testing/util-linux/write-freopen.patch
@@ -0,0 +1,27 @@
+From b89fdd9c05a6e5f12ab56441389e5ee9d1d7f30f Mon Sep 17 00:00:00 2001
+From: Karel Zak <kzak@redhat.com>
+Date: Tue, 6 Sep 2011 03:18:46 +0200
+Subject: [PATCH] write: fix path for freopen()
+
+Reported-by: xinglp <xinglp@gmail.com>
+Signed-off-by: Karel Zak <kzak@redhat.com>
+---
+ term-utils/write.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/term-utils/write.c b/term-utils/write.c
+index a825f62..a70eb7b 100644
+--- a/term-utils/write.c
++++ b/term-utils/write.c
+@@ -322,7 +322,7 @@ void do_write(char *tty, char *mytty, uid_t myuid)
+
+ if (strlen(tty) + 6 > sizeof(path))
+ errx(EXIT_FAILURE, _("tty path %s too long"), tty);
+- printf(path, "/dev/%s", tty);
++ snprintf(path, sizeof(path), "/dev/%s", tty);
+ if ((freopen(path, "w", stdout)) == NULL)
+ err(EXIT_FAILURE, "%s", path);
+
+--
+1.7.6.1
+