Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 19b6c71c authored by Mohit Aggarwal's avatar Mohit Aggarwal
Browse files

diag: Fix possible buffer overflow



Currently, while updating the real time vote
there is a possibility that index will go beyond
the array size which will lead to buffer overflow.
This patch rectifies the index checking to avoid
possible buffer overflow.

Change-Id: I71fa3698eacdcb2933dc388ca8571bb6f952becc
Signed-off-by: default avatarMohit Aggarwal <maggarwa@codeaurora.org>
parent c808da70
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
/* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2011-2016, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -788,7 +788,7 @@ void diag_update_real_time_vote(uint16_t proc, uint8_t real_time, int index)
{
	int i;

	if (index > DIAG_NUM_PROC) {
	if (index >= DIAG_NUM_PROC) {
		pr_err("diag: In %s, invalid index %d\n", __func__, index);
		return;
	}