From 1114c1a4293910e49668edfd9da96884d786f7cd Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Mon, 28 Oct 2013 18:52:12 +0100 Subject: [PATCH] core/fifo: check array index read before dereferencing uwsgi_master_fifo_manage Reported by Coverity as CID #1100821 --- core/fifo.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/fifo.c b/core/fifo.c index 1a92d9bc..c59adb55 100644 --- a/core/fifo.c +++ b/core/fifo.c @@ -114,6 +114,11 @@ int uwsgi_master_fifo_manage(int fd) { return 0; } + if ((int)cmd < 0) { + uwsgi_error("invalid cmd read in uwsgi_master_fifo_manage"); + exit(1); + } + if (uwsgi_fifo_table[(int) cmd]) { uwsgi_fifo_table[(int) cmd](0); }