projects
/
vimb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
51949de
)
Avoid possible strlen() on NULL content
author
Leonardo Taccari
<iamleot@gmail.com>
Sun, 21 Oct 2018 16:21:51 +0000
(18:21 +0200)
committer
Leonardo Taccari
<iamleot@gmail.com>
Wed, 24 Oct 2018 22:24:06 +0000
(
00:24
+0200)
src/util.c
patch
|
blob
|
history
diff --git
a/src/util.c
b/src/util.c
index
d18bc72
..
0255e54
100644
(file)
--- 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 */