Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PM / OPP: Use snprintf() instead of sprintf()
commit 5ff24d6 upstream. sprintf() can access memory outside of the range of the character array, and is risky in some situations. The driver specified prop_name string can be longer than NAME_MAX here (only an attacker will do that though) and so blindly copying it into the character array of size NAME_MAX isn't safe. Instead we must use snprintf() here. Reported-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Viresh Kumar <[email protected]> Acked-by: Geert Uytterhoeven <[email protected]> Acked-by: Stephen Boyd <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Dave Gerlach <[email protected]>
- Loading branch information