diff options
author | SHIBATA Hiroshi <shibata.hiroshi@gmail.com> | 2014-03-27 09:31:04 +0900 |
---|---|---|
committer | SHIBATA Hiroshi <shibata.hiroshi@gmail.com> | 2014-03-27 09:33:35 +0900 |
commit | 52acb800a3a026c42063288e05cd883e8864dd4b (patch) | |
tree | 2d71145a8a9196b6bc619c4f4a6c3a5103ef615c /ext | |
parent | 960d30ef5ac4ab93db199852fcd93f3cc3dfe1dd (diff) | |
download | psych-52acb800a3a026c42063288e05cd883e8864dd4b.tar.gz |
backport from libyaml-1.1.6
Diffstat (limited to 'ext')
-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 |
3 files changed, 12 insertions, 7 deletions
diff --git a/ext/psych/yaml/config.h b/ext/psych/yaml/config.h index fb62651..f54c27d 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 ea29a64..08ad8ed 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 cd3d3a5..944499c 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, \ |