File: 0001-Format-error-strings-safely.patch

package info (click to toggle)
ruby-eventmachine 0.12.10-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,356 kB
  • sloc: ruby: 8,500; cpp: 5,427; java: 1,325; makefile: 2
file content (49 lines) | stat: -rw-r--r-- 1,554 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
From: Per Andersson <avtobiff@gmail.com>
Date: Sat, 9 Jun 2012 00:48:17 +0200
Subject: Format error strings safely.

---
 ext/rubymain.cpp |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/ext/rubymain.cpp b/ext/rubymain.cpp
index e6b39e4..53510b5 100644
--- a/ext/rubymain.cpp
+++ b/ext/rubymain.cpp
@@ -499,7 +499,7 @@ static VALUE t_connect_server (VALUE self, VALUE server, VALUE port)
 			rb_raise (EM_eConnectionError, "no connection");
 		return ULONG2NUM (f);
 	} catch (std::runtime_error e) {
-		rb_raise (EM_eConnectionError, e.what());
+		rb_raise (EM_eConnectionError, "%s", e.what());
 	}
 	return Qnil;
 }
@@ -520,7 +520,7 @@ static VALUE t_bind_connect_server (VALUE self, VALUE bind_addr, VALUE bind_port
 			rb_raise (EM_eConnectionError, "no connection");
 		return ULONG2NUM (f);
 	} catch (std::runtime_error e) {
-		rb_raise (EM_eConnectionError, e.what());
+		rb_raise (EM_eConnectionError, "%s", e.what());
 	}
 	return Qnil;
 }
@@ -805,7 +805,7 @@ static VALUE t_watch_filename (VALUE self, VALUE fname)
 	try {
 		return ULONG2NUM(evma_watch_filename(StringValuePtr(fname)));
 	} catch (std::runtime_error e) {
-		rb_raise (EM_eUnsupported, e.what());
+		rb_raise (EM_eUnsupported, "%s", e.what());
 	}
 	return Qnil;
 }
@@ -831,7 +831,7 @@ static VALUE t_watch_pid (VALUE self, VALUE pid)
 	try {
 		return ULONG2NUM(evma_watch_pid(NUM2INT(pid)));
 	} catch (std::runtime_error e) {
-		rb_raise (EM_eUnsupported, e.what());
+		rb_raise (EM_eUnsupported, "%s", e.what());
 	}
 	return Qnil;
 }
--