summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Schmidt <s.schmidt@samsung.com>2020-04-17 14:12:48 +0200
committerStefan Schmidt <s.schmidt@samsung.com>2020-04-20 12:20:52 +0200
commit25f4cba10dd136bd7fdd4a92263dfdbc5d898604 (patch)
treea8e017c8aa4e0ad460892ac87d28677a49829730
parentc80b0b1360ad0b9258c36a9e09a419e6acafd30c (diff)
exactness: make sure we handle a negative file descriptor
In an error case the fd could be negative here and we should check before feeding it into fdopen(). CID: 1422197 Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D11725
-rw-r--r--src/bin/exactness/recorder.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/bin/exactness/recorder.c b/src/bin/exactness/recorder.c
index 35c747a699..59a5549131 100644
--- a/src/bin/exactness/recorder.c
+++ b/src/bin/exactness/recorder.c
@@ -265,6 +265,7 @@ _setup_fonts_dir(const char *fonts_dir)
265 if (_unit->fonts_path) 265 if (_unit->fonts_path)
266 { 266 {
267 int tmp_fd = eina_file_mkstemp("/tmp/fonts_XXXXXX.conf", &fonts_conf_name); 267 int tmp_fd = eina_file_mkstemp("/tmp/fonts_XXXXXX.conf", &fonts_conf_name);
268 if (tmp_fd < 0) return EINA_FALSE;
268 FILE *tmp_f = fdopen(tmp_fd, "wb"); 269 FILE *tmp_f = fdopen(tmp_fd, "wb");
269 fprintf(tmp_f, 270 fprintf(tmp_f,
270 "<?xml version=\"1.0\"?>\n<!DOCTYPE fontconfig SYSTEM \"fonts.dtd\">\n<fontconfig>\n" 271 "<?xml version=\"1.0\"?>\n<!DOCTYPE fontconfig SYSTEM \"fonts.dtd\">\n<fontconfig>\n"