@@ -217,10 +217,13 @@ bool cfw_string_append(CFWString *str, CFWString *append) { char *new; + + if (append == NULL) + return true; if ((new = realloc(str->data, str->len + append->len + 1)) == NULL) return false; memcpy(new + str->len, append->data, append->len); @@ -233,12 +236,17 @@ } bool cfw_string_append_c(CFWString *str, const char *append) { - size_t append_len = strlen(append); char *new; + size_t append_len; + + if (append == NULL) + return true; + + append_len = strlen(append); if ((new = realloc(str->data, str->len + append_len + 1)) == NULL) return false; memcpy(new + str->len, append, append_len);