Skip to content
Commit b3a8692d authored by Dan Carpenter's avatar Dan Carpenter Committed by Hans de Goede
Browse files

platform/x86: hp-bioscfg: prevent a small buffer overflow



This function escapes certain special characters like \n.  So if the
last character in the string is a '\n' then it gets changed into two
characters '\' and '\n'.  But maybe we only have space for the '\' so
we need to check for that.

The "conv_dst_size" variable is always less than or to equal the "size"
variable.  It's easier to just check "conv_dst_size" instead of checking
both.

Fixes: a34fc329 ("platform/x86: hp-bioscfg: bioscfg")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/b4950310-e65f-412f-8d2b-90bb074a6572@moroto.mountain


Reviewed-by: default avatarJorge Lopez <jorge.lopez2@hp.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent 93d99fd8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment