diff options
author | Anthon van der Neut <anthon@mnt.org> | 2017-06-09 09:41:42 +0200 |
---|---|---|
committer | Anthon van der Neut <anthon@mnt.org> | 2017-06-09 09:41:42 +0200 |
commit | 9d2c07760ce6583c8875b9f1e5b4e494fcd654b4 (patch) | |
tree | 8a2ade75c11025ef634e41c637e76d6098548639 /ext | |
parent | cb15ef0ad512c00584ff4195ca88334d1f2b0fa6 (diff) | |
download | ruamel.yaml-9d2c07760ce6583c8875b9f1e5b4e494fcd654b4.tar.gz |
update from libyaml
Diffstat (limited to 'ext')
-rw-r--r-- | ext/api.c | 2 | ||||
-rw-r--r-- | ext/config.h | 10 | ||||
-rw-r--r-- | ext/scanner.c | 10 | ||||
-rw-r--r-- | ext/yaml_private.h | 7 |
4 files changed, 14 insertions, 15 deletions
@@ -415,7 +415,7 @@ yaml_string_write_handler(void *data, unsigned char *buffer, size_t size) { yaml_emitter_t *emitter = data; - if (emitter->output.string.size + *emitter->output.string.size_written + if (emitter->output.string.size - *emitter->output.string.size_written < size) { memcpy(emitter->output.string.buffer + *emitter->output.string.size_written, diff --git a/ext/config.h b/ext/config.h index ecb7e85..20f1431 100644 --- a/ext/config.h +++ b/ext/config.h @@ -45,7 +45,7 @@ #define PACKAGE_NAME "yaml" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "yaml 0.1.5" +#define PACKAGE_STRING "yaml 0.1.7" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "yaml" @@ -54,13 +54,13 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "0.1.5" +#define PACKAGE_VERSION "0.1.7" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Version number of package */ -#define VERSION "0.1.5" +#define VERSION "0.1.7" /* Define the major version number. */ #define YAML_VERSION_MAJOR 0 @@ -69,10 +69,10 @@ #define YAML_VERSION_MINOR 1 /* Define the patch version number. */ -#define YAML_VERSION_PATCH 5 +#define YAML_VERSION_PATCH 7 /* Define the version string. */ -#define YAML_VERSION_STRING "0.1.5" +#define YAML_VERSION_STRING "0.1.7" /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ diff --git a/ext/scanner.c b/ext/scanner.c index a5d69c0..dfb9c6d 100644 --- a/ext/scanner.c +++ b/ext/scanner.c @@ -1106,13 +1106,6 @@ yaml_parser_save_simple_key(yaml_parser_t *parser) && parser->indent == (ptrdiff_t)parser->mark.column); /* - * A simple key is required only when it is the first token in the current - * line. Therefore it is always allowed. But we add a check anyway. - */ - - assert(parser->simple_key_allowed || !required); /* Impossible. */ - - /* * If the current position may start a simple key, save it. */ @@ -2629,6 +2622,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/yaml_private.h b/ext/yaml_private.h index 9f39776..15d0660 100644 --- a/ext/yaml_private.h +++ b/ext/yaml_private.h @@ -141,9 +141,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, \ |