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

Commit 24dc742a authored by Ruchi Kandoi's avatar Ruchi Kandoi
Browse files

wakeup: Add the guard condition for len in pm_get_active_wakeup_sources



Check if the len is not greater than maximum to prevent buffer overflow.

Signed-off-by: default avatarRuchi Kandoi <kandoiruchi@google.com>
Change-Id: I575b0a72bb5448b68353408d71fa8b83420c9088
parent 4f4f7cc3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -677,7 +677,7 @@ void pm_get_active_wakeup_sources(char *pending_wakeup_source, size_t max)

	rcu_read_lock();
	list_for_each_entry_rcu(ws, &wakeup_sources, entry) {
		if (ws->active) {
		if (ws->active && len < max) {
			if (!active)
				len += scnprintf(pending_wakeup_source, max,
						"Pending Wakeup Sources: ");