From 25f4cba10dd136bd7fdd4a92263dfdbc5d898604 Mon Sep 17 00:00:00 2001 From: Stefan Schmidt Date: Fri, 17 Apr 2020 14:12:48 +0200 Subject: [PATCH] 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 Differential Revision: https://phab.enlightenment.org/D11725 --- src/bin/exactness/recorder.c | 1 + 1 file changed, 1 insertion(+) 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) if (_unit->fonts_path) { int tmp_fd = eina_file_mkstemp("/tmp/fonts_XXXXXX.conf", &fonts_conf_name); + if (tmp_fd < 0) return EINA_FALSE; FILE *tmp_f = fdopen(tmp_fd, "wb"); fprintf(tmp_f, "\n\n\n"