Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
of/device: Prevent buffer overflow in of_device_modalias()
As of_device_get_modalias() returns the number of bytes that would have been written to the target string, regardless of how much did fit in the buffer, it's possible that the returned index points beyond the buffer passed to of_device_modalias() - causing memory beyond the buffer to be null terminated. Fixes: 0634c29 ("of: Add function for generating a DT modalias with a newline") Cc: Rob Herring <[email protected]> Cc: [email protected] Signed-off-by: Bjorn Andersson <[email protected]> Signed-off-by: Rob Herring <[email protected]>
- Loading branch information