Permalink
Browse files

merge revision(s) 26903:

	* ext/nkf/nkf-utf8/nkf.c (numchar_getc): get rid of buffer
	  overflow.  [ruby-dev:40606]


git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8_7@28195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
1 parent 4ca5c28 commit 5d4d279b45d54a70079b7728b318fad14f82a59e @shyouhei shyouhei committed Jun 7, 2010
Showing with 12 additions and 2 deletions.
  1. +5 −0 ChangeLog
  2. +1 −1 ext/nkf/nkf-utf8/nkf.c
  3. +5 −0 test/nkf/test_nkf.rb
  4. +1 −1 version.h
View
@@ -1,3 +1,8 @@
+Mon Jun 7 19:23:04 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/nkf/nkf-utf8/nkf.c (numchar_getc): get rid of buffer
+ overflow. [ruby-dev:40606]
+
Mon Jun 7 18:57:02 2010 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
* ext/openssl/ossl_ssl_session.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);
@@ -13,4 +13,9 @@ def test_guess
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
View
@@ -2,7 +2,7 @@
#define RUBY_RELEASE_DATE "2010-06-07"
#define RUBY_VERSION_CODE 187
#define RUBY_RELEASE_CODE 20100607
-#define RUBY_PATCHLEVEL 267
+#define RUBY_PATCHLEVEL 268
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8

0 comments on commit 5d4d279

Please sign in to comment.