Skip to content

Commit

Permalink
Fixed segfault in yaml_string_write_handler.
Browse files Browse the repository at this point in the history
  • Loading branch information
xitology committed Jun 5, 2016
1 parent 9465961 commit 686b2d8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 686b2d8

Please sign in to comment.