core/fifo: check array index read before dereferencing uwsgi_master_fifo_manage

Reported by Coverity as CID #1100821
This commit is contained in:
Riccardo Magliocchetti
2013-10-28 19:29:25 +01:00
parent f58a9c6119
commit 1114c1a429
+5
View File
@@ -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);
}