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

Commit 50b311fd authored by Kiran Gunda's avatar Kiran Gunda
Browse files

regulator: core: Fix buffer overflow issue



There is a possible buffer overflow in the "reg_debug_volt_get"
function. Fix it by passing the appropriate byte count.

Change-Id: I30868790c42cdb225af74054532a75c49506fe82
Signed-off-by: default avatarKiran Gunda <kgunda@codeaurora.org>
parent 4a06d597
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3824,7 +3824,7 @@ static ssize_t reg_debug_volt_get(struct file *file, char __user *buf,
	mutex_lock(&debug_buf_mutex);

	output = snprintf(debug_buf, MAX_DEBUG_BUF_LEN-1, "%d\n", voltage);
	rc = simple_read_from_buffer((void __user *) buf, output, ppos,
	rc = simple_read_from_buffer((void __user *) buf, count, ppos,
					(void *) debug_buf, output);

	mutex_unlock(&debug_buf_mutex);