From 0ed72711716b9fe08b6e6613cc33bddbd400e0be Mon Sep 17 00:00:00 2001 From: Leonardo Taccari Date: Sun, 21 Oct 2018 18:21:51 +0200 Subject: [PATCH] Avoid possible strlen() on NULL content --- src/util.c | 5 +++++ 1 file changed, 5 insertions(+) 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 */ -- 2.20.1