aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/fstring.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-05-06 14:32:32 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-05-06 14:32:32 +0100
commitbc40fb5b409f728123bcb03bf904c01e45a1d887 (patch)
tree5cdb5c1b7ea491ec98815bbfa7fe84632d49a0fd /src/libutil/fstring.c
parent654584a9b9510ec44cab149e6e2cd41108776886 (diff)
downloadrspamd-bc40fb5b409f728123bcb03bf904c01e45a1d887.tar.gz
rspamd-bc40fb5b409f728123bcb03bf904c01e45a1d887.zip
[Minor] Allow to assign NULL string
Diffstat (limited to 'src/libutil/fstring.c')
-rw-r--r--src/libutil/fstring.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libutil/fstring.c b/src/libutil/fstring.c
index 15cbb41be..4aa678b0b 100644
--- a/src/libutil/fstring.c
+++ b/src/libutil/fstring.c
@@ -79,7 +79,13 @@ rspamd_fstring_new_init (const gchar *init, gsize len)
rspamd_fstring_t *
rspamd_fstring_assign (rspamd_fstring_t *str, const gchar *init, gsize len)
{
- gsize avail = fstravail (str);
+ gsize avail;
+
+ if (str == NULL) {
+ return rspamd_fstring_new_init (init, len);
+ }
+
+ avail = fstravail (str);
if (avail < len) {
str = rspamd_fstring_grow (str, len);