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 <chuang213@gmail.com>
This commit is contained in:
Frank Huang
2019-02-17 08:12:42 +00:00
parent 2d42c22919
commit d3cb2e8f53

View File

@@ -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;