From 945b8850c34a51d328754e14f830fc8f4b1fe6b0 Mon Sep 17 00:00:00 2001 From: Stefan Schmidt Date: Fri, 17 Apr 2020 15:23:44 +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(). This is the same patch we used in recorder.c CID: 1422194 Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D11728 --- src/bin/exactness/player.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bin/exactness/player.c b/src/bin/exactness/player.c index 870cc51..2dcf3f5 100644 --- a/src/bin/exactness/player.c +++ b/src/bin/exactness/player.c @@ -983,6 +983,7 @@ _setup_font_settings(const char *fonts_dir) if (chosen_fonts) { 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" -- 2.7.4