summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwyhaines <wyhaines@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-06-09 21:52:26 +0000
committerwyhaines <wyhaines@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-06-09 21:52:26 +0000
commitc43e977e2896d57f616919a6c9c7301f7fae9804 (patch)
tree040feec70116df906c48901a0e86969e7f620078
parent09a7d0173b672e9ba2e0062bf23acbf232afe1cc (diff)
downloadruby-c43e977e2896d57f616919a6c9c7301f7fae9804.tar.gz
ext/nkf/nkf-utf8/nkf.c: Backport #2953 [ruby-dev:40606]; change nkf_char buffer in numchar_getc() size form 8 to 10 to avoid potential for a segfault.
test/nkf/test_nkf.rb: Added a test for the change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@28242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog8
-rw-r--r--ext/nkf/nkf-utf8/nkf.c2
-rw-r--r--test/nkf/test_nkf.rb6
-rw-r--r--version.h2
4 files changed, 15 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 55db17c6ef..cd3f6e115d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,12 @@
+Thu Jun 10 06:46:00 Kirk Haines <khaines@ruby-ang.org>
+
+ * ext/nkf/nkf-utf8/nkf.c: Backport #2953 [ruby-dev:40606]; change nkf_char buffer in numchar_getc() size form 8 to 10 to avoid potential for a segfault.
+
+ * test/nkf/test_nkf.rb: Added a test for the change.
+
Thu Jun 10 01:40:00 Kirk Haines <khaines@ruby-lang.org>
- * lib/delegate.rb: Backport #1781 [ruby-core:24356]; allow a block to be properly passed through.
+ * lib/delegate.rb: Backport #1781 [ruby-core:24356]; allow a block to be properly passed through. r28239
Wed Jun 9 04:35:00 Kirk Haines <khaines@ruby-lang.org>
diff --git a/ext/nkf/nkf-utf8/nkf.c b/ext/nkf/nkf-utf8/nkf.c
index 9a31c9d879..168cbdbf8b 100644
--- a/ext/nkf/nkf-utf8/nkf.c
+++ b/ext/nkf/nkf-utf8/nkf.c
@@ -5004,7 +5004,7 @@ nkf_char numchar_getc(FILE *f)
nkf_char (*g)(FILE *) = i_ngetc;
nkf_char (*u)(nkf_char c ,FILE *f) = i_nungetc;
int i = 0, j;
- nkf_char buf[8];
+ nkf_char buf[10];
long c = -1;
buf[i] = (*g)(f);
diff --git a/test/nkf/test_nkf.rb b/test/nkf/test_nkf.rb
index 279ad59e1a..ab5c8f4305 100644
--- a/test/nkf/test_nkf.rb
+++ b/test/nkf/test_nkf.rb
@@ -13,4 +13,10 @@ Ruby"
assert_equal(::NKF::EUC, NKF.guess(str_euc))
end
+ def test_numchar_input
+ bug2953 = '[ruby-dev:40606]'
+ assert_equal("A", NKF.nkf("-w --numchar-input", "&#x000041;"), bug2953)
+ assert_equal("B", NKF.nkf("-w --numchar-input", "&#0000066;"), bug2953)
+ end
+
end
diff --git a/version.h b/version.h
index 6c1b7e5b55..358aad7598 100644
--- a/version.h
+++ b/version.h
@@ -2,7 +2,7 @@
#define RUBY_RELEASE_DATE "2010-06-10"
#define RUBY_VERSION_CODE 186
#define RUBY_RELEASE_CODE 20100610
-#define RUBY_PATCHLEVEL 412
+#define RUBY_PATCHLEVEL 413
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8