From 2560fdb7507a30995481096dfa12e917de0584b0 Mon Sep 17 00:00:00 2001 From: Andrei Emeltchenko Date: Fri, 4 Jul 2014 16:43:57 +0300 Subject: [PATCH] android/haltest: Add check for valid channel Channel is got from user and needs to be validated before use as index in the array. --- android/client/if-hl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/android/client/if-hl.c b/android/client/if-hl.c index 17ba16c6f..a3c351c13 100644 --- a/android/client/if-hl.c +++ b/android/client/if-hl.c @@ -329,6 +329,10 @@ static void close_channel_p(int argc, const char **argv) } channel_id = atoi(argv[4]); + if (channel_id >= CHANNEL_ID_SIZE) { + haltest_error("Wrong channel id: %u\n", channel_id); + return; + } if (app[app_id].mdep[index].channel[channel_id].fd >= 0) { shutdown(app[app_id].mdep[index].channel[channel_id].fd, -- 2.47.3