Heinrich Schuchardt 15bbcafab1 efi_loader: fix get_last_capsule()
fix get_last_capsule() leads to writes beyond the stack allocated buffer.
This was indicated when enabling the stack protector.

utf16_utf8_strcpy() only stops copying when reaching '\0'. The current
invocation always writes beyond the end of value[].

The output length of utf16_utf8_strcpy() may be longer than the number of
UTF-16 tokens. E.g has "CapsuleКиев" has 11 UTF-16 tokens but 15 UTF-8
tokens. Hence, using utf16_utf8_strcpy() without checking the input may
lead to further writes beyond value[].

The current invocation of strict_strtoul() reads beyond the end of value[].

A non-hexadecimal value after "Capsule" (e.g. "CapsuleZZZZ") must result in
an error. We cat catch this by checking the return value of strict_strtoul().

A value that is too short after "Capsule" (e.g. "Capsule0") must result in
an error. We must check the string length of value[].

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-02-14 10:34:15 +01:00
..
2021-01-16 19:17:11 -05:00
2020-05-18 21:19:18 -04:00
2011-01-18 23:38:08 +01:00
2019-12-02 18:23:07 -05:00
2019-10-31 07:22:53 -04:00
2010-09-19 19:29:47 +02:00
2020-10-30 10:56:11 -04:00
2020-04-24 10:51:32 -04:00
2021-01-27 17:03:16 -05:00
2012-04-29 14:14:08 +02:00
2019-12-06 16:44:20 -05:00
2020-05-18 21:19:18 -04:00
2020-06-12 13:14:07 -04:00
2020-05-18 21:19:18 -04:00
2020-11-05 14:58:45 +08:00
2020-08-24 14:11:31 -04:00
2021-01-05 12:24:40 -07:00
2020-05-01 11:03:24 -04:00
2020-05-18 21:19:18 -04:00
2020-10-27 21:13:15 +01:00
2021-01-19 09:15:02 -05:00
2019-05-05 08:48:50 -04:00