Skip to content

Commit c43e977

Browse files
author
wyhaines
committed
ext/nkf/nkf-utf8/nkf.c: Backport ruby#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
1 parent 09a7d01 commit c43e977

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

ChangeLog

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1+
Thu Jun 10 06:46:00 Kirk Haines <khaines@ruby-ang.org>
2+
3+
* 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.
4+
5+
* test/nkf/test_nkf.rb: Added a test for the change.
6+
17
Thu Jun 10 01:40:00 Kirk Haines <khaines@ruby-lang.org>
28

3-
* lib/delegate.rb: Backport #1781 [ruby-core:24356]; allow a block to be properly passed through.
9+
* lib/delegate.rb: Backport #1781 [ruby-core:24356]; allow a block to be properly passed through. r28239
410

511
Wed Jun 9 04:35:00 Kirk Haines <khaines@ruby-lang.org>
612

ext/nkf/nkf-utf8/nkf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5004,7 +5004,7 @@ nkf_char numchar_getc(FILE *f)
50045004
nkf_char (*g)(FILE *) = i_ngetc;
50055005
nkf_char (*u)(nkf_char c ,FILE *f) = i_nungetc;
50065006
int i = 0, j;
5007-
nkf_char buf[8];
5007+
nkf_char buf[10];
50085008
long c = -1;
50095009

50105010
buf[i] = (*g)(f);

test/nkf/test_nkf.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,10 @@ def test_guess
1313
assert_equal(::NKF::EUC, NKF.guess(str_euc))
1414
end
1515

16+
def test_numchar_input
17+
bug2953 = '[ruby-dev:40606]'
18+
assert_equal("A", NKF.nkf("-w --numchar-input", "&#x000041;"), bug2953)
19+
assert_equal("B", NKF.nkf("-w --numchar-input", "&#0000066;"), bug2953)
20+
end
21+
1622
end

version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#define RUBY_RELEASE_DATE "2010-06-10"
33
#define RUBY_VERSION_CODE 186
44
#define RUBY_RELEASE_CODE 20100610
5-
#define RUBY_PATCHLEVEL 412
5+
#define RUBY_PATCHLEVEL 413
66

77
#define RUBY_VERSION_MAJOR 1
88
#define RUBY_VERSION_MINOR 8

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy