From 686b2d8507f0f751be91f0666eb87f62c67a28f8 Mon Sep 17 00:00:00 2001 From: Kirill Simonov Date: Sun, 5 Jun 2016 13:02:56 -0500 Subject: [PATCH] Fixed segfault in yaml_string_write_handler. --- CMakeLists.txt | 2 +- configure.ac | 4 ++-- src/api.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e84c28c..9bfe761 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ project (yaml C) set (YAML_VERSION_MAJOR 0) set (YAML_VERSION_MINOR 1) -set (YAML_VERSION_PATCH 6) +set (YAML_VERSION_PATCH 7) set (YAML_VERSION_STRING "${YAML_VERSION_MAJOR}.${YAML_VERSION_MINOR}.${YAML_VERSION_PATCH}") file (GLOB SRC src/*.c) diff --git a/configure.ac b/configure.ac index dd1aca0..2f88f8a 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ # Define the package version numbers and the bug reporting link. m4_define([YAML_MAJOR], 0) m4_define([YAML_MINOR], 1) -m4_define([YAML_PATCH], 6) +m4_define([YAML_PATCH], 7) m4_define([YAML_BUGS], [http://pyyaml.org/newticket?component=libyaml]) # Define the libtool version numbers; check the Autobook, Section 11.4. @@ -19,7 +19,7 @@ m4_define([YAML_BUGS], [http://pyyaml.org/newticket?component=libyaml]) # YAML_AGE = 0 m4_define([YAML_RELEASE], 0) m4_define([YAML_CURRENT], 2) -m4_define([YAML_REVISION], 4) +m4_define([YAML_REVISION], 5) m4_define([YAML_AGE], 0) # Initialize autoconf & automake. diff --git a/src/api.c b/src/api.c index 0c4732e..b1a8da0 100644 --- a/src/api.c +++ b/src/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, -- 2.45.1