summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2017-06-09 09:41:42 +0200
committerAnthon van der Neut <anthon@mnt.org>2017-06-09 09:41:42 +0200
commit9d2c07760ce6583c8875b9f1e5b4e494fcd654b4 (patch)
tree8a2ade75c11025ef634e41c637e76d6098548639
parentcb15ef0ad512c00584ff4195ca88334d1f2b0fa6 (diff)
downloadruamel.yaml-9d2c07760ce6583c8875b9f1e5b4e494fcd654b4.tar.gz
update from libyaml
-rw-r--r--_doc/install.rst9
-rw-r--r--ext/api.c2
-rw-r--r--ext/config.h10
-rw-r--r--ext/scanner.c10
-rw-r--r--ext/yaml_private.h7
5 files changed, 18 insertions, 20 deletions
diff --git a/_doc/install.rst b/_doc/install.rst
index e90f9e7..86ff508 100644
--- a/_doc/install.rst
+++ b/_doc/install.rst
@@ -15,16 +15,15 @@ files (JSON,INI,HTML tables)
Optional requirements
---------------------
-If you have the C yaml library and headers installed, as well as
-the header files for your Python executables then you can use the
-non-roundtrip, but faster, C loader and emitter.
+If you have the the header files for your Python executables installed
+then you can use the (non-roundtrip), but faster, C loader and emitter.
On Debian systems you should use::
- sudo apt-get install libyaml-dev python-dev python3-dev
+ sudo apt-get install python3-dev
you can leave out ``python3-dev`` if you don't use python3
For CentOS (7) based systems you should do::
- sudo yum install libyaml-devel python-devel
+ sudo yum install python-devel
diff --git a/ext/api.c b/ext/api.c
index 0c4732e..b1a8da0 100644
--- a/ext/api.c
+++ b/ext/api.c
@@ -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, \