From: Leonardo Taccari Date: Sun, 21 Oct 2018 16:21:51 +0000 (+0200) Subject: Avoid possible strlen() on NULL content X-Git-Url: https://git.owens.tech/assets/static/git-logo.png/assets/static/git-logo.png/git?a=commitdiff_plain;h=0ed72711716b9fe08b6e6613cc33bddbd400e0be;p=vimb.git Avoid possible strlen() on NULL content --- diff --git a/src/util.c b/src/util.c index d18bc72..0255e54 100644 --- a/src/util.c +++ b/src/util.c @@ -133,6 +133,11 @@ gboolean util_create_tmp_file(const char *content, char **file) return FALSE; } + if (content == NULL) { + close(fp); + return TRUE; + } + len = strlen(content); /* write content into temporary file */