diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-07 17:30:15 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-07 17:30:15 +0000 |
commit | 30340160a4b0b003dc27e2e347e0892405ed1a48 (patch) | |
tree | de1884d7097e10545e3af6fdecdeb34ce13ee85a | |
parent | 9bececb77cc14b5e3c4a2767d2d7e704ccc8127e (diff) |
merge revision(s) r45453: [Backport #9798]
* ext/psych/yaml/config.h: ditto.
* ext/psych/yaml/scanner.c: ditto.
* ext/psych/yaml/yaml_private.h: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@45870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | ext/psych/yaml/config.h | 9 | ||||
-rw-r--r-- | ext/psych/yaml/scanner.c | 3 | ||||
-rw-r--r-- | ext/psych/yaml/yaml_private.h | 7 | ||||
-rw-r--r-- | test/psych/test_encoding.rb | 5 | ||||
-rw-r--r-- | version.h | 2 |
6 files changed, 26 insertions, 8 deletions
@@ -1,3 +1,11 @@ +Mon May 5 00:42:35 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com> + + * ext/psych/yaml/config.h: ditto. + + * ext/psych/yaml/scanner.c: ditto. + + * ext/psych/yaml/yaml_private.h: ditto. + Thu May 8 02:01:51 2014 Kenta Murata <mrkn@mrkn.jp> * ext/bigdecimal/bigdecimal.c (BigDecimal_initialize): Insert GC guard. diff --git a/ext/psych/yaml/config.h b/ext/psych/yaml/config.h index fb62651340..f54c27d339 100644 --- a/ext/psych/yaml/config.h +++ b/ext/psych/yaml/config.h @@ -1,11 +1,10 @@ - #define PACKAGE_NAME "yaml" #define PACKAGE_TARNAME "yaml" -#define PACKAGE_VERSION "0.1.5" -#define PACKAGE_STRING "yaml 0.1.5" +#define PACKAGE_VERSION "0.1.6" +#define PACKAGE_STRING "yaml 0.1.6" #define PACKAGE_BUGREPORT "http://pyyaml.org/newticket?component libyaml" #define PACKAGE_URL "" #define YAML_VERSION_MAJOR 0 #define YAML_VERSION_MINOR 1 -#define YAML_VERSION_PATCH 5 -#define YAML_VERSION_STRING "0.1.5" +#define YAML_VERSION_PATCH 6 +#define YAML_VERSION_STRING "0.1.6" diff --git a/ext/psych/yaml/scanner.c b/ext/psych/yaml/scanner.c index 34308d5d45..af05766f5c 100644 --- a/ext/psych/yaml/scanner.c +++ b/ext/psych/yaml/scanner.c @@ -2629,6 +2629,9 @@ yaml_parser_scan_tag_uri(yaml_parser_t *parser, int directive, /* Check if it is a URI-escape sequence. */ if (CHECK(parser->buffer, '%')) { + if (!STRING_EXTEND(parser, string)) + goto error; + if (!yaml_parser_scan_uri_escapes(parser, directive, start_mark, &string)) goto error; } diff --git a/ext/psych/yaml/yaml_private.h b/ext/psych/yaml/yaml_private.h index cd3d3a56c4..944499c94e 100644 --- a/ext/psych/yaml/yaml_private.h +++ b/ext/psych/yaml/yaml_private.h @@ -146,9 +146,12 @@ yaml_string_join( (string).start = (string).pointer = (string).end = 0) #define STRING_EXTEND(context,string) \ - (((string).pointer+5 < (string).end) \ + ((((string).pointer+5 < (string).end) \ || yaml_string_extend(&(string).start, \ - &(string).pointer, &(string).end)) + &(string).pointer, &(string).end)) ? \ + 1 : \ + ((context)->error = YAML_MEMORY_ERROR, \ + 0)) #define CLEAR(context,string) \ ((string).pointer = (string).start, \ diff --git a/test/psych/test_encoding.rb b/test/psych/test_encoding.rb index 1abee0df16..f48f5c9032 100644 --- a/test/psych/test_encoding.rb +++ b/test/psych/test_encoding.rb @@ -31,6 +31,11 @@ module Psych @emitter = Psych::Emitter.new @buffer end + def test_dump_load_encoding_object + assert_cycle Encoding::US_ASCII + assert_cycle Encoding::UTF_8 + end + def test_transcode_shiftjis str = "こんにちは!" loaded = Psych.load("--- こんにちは!".encode('SHIFT_JIS')) @@ -1,6 +1,6 @@ #define RUBY_VERSION "2.0.0" #define RUBY_RELEASE_DATE "2014-05-08" -#define RUBY_PATCHLEVEL 479 +#define RUBY_PATCHLEVEL 480 #define RUBY_RELEASE_YEAR 2014 #define RUBY_RELEASE_MONTH 5 |