Commit 80744a3b authored by Dan Carpenter's avatar Dan Carpenter Committed by Rafael J. Wysocki
Browse files

ACPI: APEI: EINJ: prevent memory corruption in error_type_set()



The "einj_buf" buffer is 32 chars.  If "count" is larger than that it
results in memory corruption.  Cap it at 31 so that we leave the last
character as a NUL terminator.  By the way, the highest reasonable value
for "count" is 24.

Fixes: 0c6176e1 ("ACPI: APEI: EINJ: Enable the discovery of EINJv2 capabilities")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: default avatarIra Weiny <ira.weiny@intel.com>
Link: https://patch.msgid.link/ae6286cf-4d73-4b97-8c0f-0782a65b8f51@sabinyo.mountain


Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 8b148a97
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment