From 8c2afaf251d5b65c82723be22ba2c23913343bef Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 12 Jul 2017 12:00:52 -0400 Subject: [PATCH] efl_wl: check mkstemp return CID 1377533 --- src/lib/efl_wl/efl_wl.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/lib/efl_wl/efl_wl.c b/src/lib/efl_wl/efl_wl.c index 6f9dd31..99509de 100644 --- a/src/lib/efl_wl/efl_wl.c +++ b/src/lib/efl_wl/efl_wl.c @@ -3466,6 +3466,14 @@ seat_keymap_update(Comp_Seat *s) str = xkb_map_get_as_string(s->kbd.keymap); s->kbd.keymap_mem_size = strlen(str) + 1; s->kbd.keymap_fd = eina_file_mkstemp("comp-keymapXXXXXX", &file); + if (s->kbd.keymap_fd < 0) + { + EINA_LOG_ERR("mkstemp failed!\n"); + s->kbd.keymap_fd = -1; + xkb_state_unref(s->kbd.state); + s->kbd.state = NULL; + return; + } if (!eina_file_close_on_exec(s->kbd.keymap_fd, 1)) { EINA_LOG_ERR("Failed to set CLOEXEC on fd %d\n", s->kbd.keymap_fd); -- 2.7.4