From ede824ce44b171bd5a1bf4e01b674b7a8dbf5842 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Fri, 30 Oct 2015 14:36:12 +0100 Subject: [PATCH] str: str_append_str was made more safe and tolerate null --- src/str.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/str.c b/src/str.c index c1d7ca91..5682830d 100644 --- a/src/str.c +++ b/src/str.c @@ -121,6 +121,10 @@ int str_append_data_prefix1(str_st * dest, const void *data, size_t data_size) int str_append_str(str_st * dest, const char *src) { int ret; + + if (src == NULL) + return -1; + ret = str_append_data(dest, src, strlen(src) + 1); if (ret >= 0) dest->length--;