on master help sign in
Upgrade to libyaml-0.1.7
commit3e93a7f499b5337af1f5a4c1f9b28ede762319ec authorMichael Snoyman <michael@snoyman.com> dateTue 18 Oct 2016, 17:08 (10 years ago) parentb034be9
5 files changed+16−13
ChangeLog.md+4 libyaml/api.c+1−1 libyaml/scanner.c+3−7 libyaml/yaml_private.h+7−4 yaml.cabal+1−1
ChangeLog.md+4
@@ -1,3 +1,7 @@
1+## 0.8.20
2+
3+* Upgrade to libyaml 0.1.7
4+
15## 0.8.19.0
26
37* Add `Data.Yaml.TH` module
libyaml/api.c+1−1
@@ -424,7 +424,7 @@ yaml_string_write_handler(void *data, unsigned char *buffer, size_t size)
424424{
425425 yaml_emitter_t *emitter = data;
426426
427− if (emitter->output.string.size + *emitter->output.string.size_written
427+ if (emitter->output.string.size - *emitter->output.string.size_written
428428 < size) {
429429 memcpy(emitter->output.string.buffer
430430 + *emitter->output.string.size_written,
libyaml/scanner.c+3−7
@@ -1105,13 +1105,6 @@ yaml_parser_save_simple_key(yaml_parser_t *parser)
11051105 int required = (!parser->flow_level
11061106 && parser->indent == (ptrdiff_t)parser->mark.column);
11071107
1108− /*
1109− * A simple key is required only when it is the first token in the current
1110− * line. Therefore it is always allowed. But we add a check anyway.
1111− */
1112−
1113− assert(parser->simple_key_allowed || !required); /* Impossible. */
1114−
11151108 /*
11161109 * If the current position may start a simple key, save it.
11171110 */
@@ -2629,6 +2622,9 @@ yaml_parser_scan_tag_uri(yaml_parser_t *parser, int directive,
26292622 /* Check if it is a URI-escape sequence. */
26302623
26312624 if (CHECK(parser->buffer, '%')) {
2625+ if (!STRING_EXTEND(parser, string))
2626+ goto error;
2627+
26322628 if (!yaml_parser_scan_uri_escapes(parser,
26332629 directive, start_mark, &string)) goto error;
26342630 }
libyaml/yaml_private.h+7−4
@@ -143,9 +143,12 @@ yaml_string_join(
143143 (string).start = (string).pointer = (string).end = 0)
144144
145145#define STRING_EXTEND(context,string) \
146− (((string).pointer+5 < (string).end) \
146+ ((((string).pointer+5 < (string).end) \
147147 || yaml_string_extend(&(string).start, \
148− &(string).pointer, &(string).end))
148+ &(string).pointer, &(string).end)) ? \
149+ 1 : \
150+ ((context)->error = YAML_MEMORY_ERROR, \
151+ 0))
149152
150153#define CLEAR(context,string) \
151154 ((string).pointer = (string).start, \
@@ -655,7 +658,7 @@ yaml_queue_extend(void **start, void **head, void **tail, void **end);
655658 (node).data.mapping.pairs.top = (node_pairs_start), \
656659 (node).data.mapping.style = (node_style))
657660
658−#define YAML_VERSION_STRING "0.1.5"
661+#define YAML_VERSION_STRING "0.1.7"
659662#define YAML_VERSION_MAJOR 0
660663#define YAML_VERSION_MINOR 1
661−#define YAML_VERSION_PATCH 5
664+#define YAML_VERSION_PATCH 7
yaml.cabal+1−1
@@ -1,5 +1,5 @@
11name: yaml
2−version: 0.8.19.0
2+version: 0.8.20
33license: BSD3
44license-file: LICENSE
55author: Michael Snoyman <michael@snoyman.com>, Anton Ageev <antage@gmail.com>,Kirill Simonov