From d3cb2e8f53eb36ae007c6dd5cfa6a8455d741b5e Mon Sep 17 00:00:00 2001 From: Frank Huang Date: Sun, 17 Feb 2019 08:12:42 +0000 Subject: [PATCH] Fix the bug of "ocserv-worker: segfault at 0 ip b76d6747 sp bf851c70", https://gitlab.com/openconnect/ocserv/issues/197 It must be some caller does not add extra size for null at the end Signed-off-by: Frank Huang --- src/str.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/str.c b/src/str.c index c95c54f6..91d955bf 100644 --- a/src/str.c +++ b/src/str.c @@ -103,9 +103,9 @@ int str_append_size(str_st * dest, size_t data_size) */ int str_append_data(str_st * dest, const void *data, size_t data_size) { -int ret; + int ret; - ret = str_append_size(dest, data_size); + ret = str_append_size(dest, data_size+1); if (ret < 0) return ret;