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

Commit a0612ff8 authored by Venkat Gopalakrishnan's avatar Venkat Gopalakrishnan Committed by Prasad Sodagudi
Browse files

trace: Fix array index out of bounds violation



The trace sequence buffer max is only PAGE_SIZE, make sure the
length is validated before accessing the array.

Change-Id: I65848257fc4249def83fe68bb2dba1c6e73b841d
Signed-off-by: default avatarVenkat Gopalakrishnan <venkatg@codeaurora.org>
Signed-off-by: default avatarPrasad Sodagudi <psodagud@codeaurora.org>
parent 5a79eb4a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -81,7 +81,7 @@ int trace_seq_printf(struct trace_seq *s, const char *fmt, ...)
	va_list ap;
	int ret;

	if (s->full || !len)
	if (s->full || !len || (s->len >= (PAGE_SIZE - 1)))
		return 0;

	va_start(ap, fmt);