Gilles Peskine
995d89c9f2
Fix null pointer arithmetic in error case
...
When mbedtls_nist_kw_wrap was called with output=NULL and out_size=0, it
performed arithmetic on the null pointer before detecting that the output
buffer is too small and returning an error code. This was unlikely to have
consequences on real-world hardware today, but it is undefined behavior and
UBSan with Clang 10 flagged it. So fix it (fix #4025 ).
Fix a similar-looking pattern in unwrap, though I haven't verified that it's
reachable there.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com >
2021-06-01 13:03:34 +02:00
..
2015-06-25 10:59:56 +02:00
2020-11-09 20:44:12 +01:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00
2021-05-25 18:45:46 +02:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00
2021-03-04 14:43:17 +00:00
2021-04-09 16:32:08 +02:00
2020-08-19 16:37:36 +02:00
2021-05-25 18:45:46 +02:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00
2020-11-06 15:26:52 +01:00
2020-08-19 16:37:36 +02:00
2020-11-28 12:14:57 -03:00
2021-03-09 16:03:29 +00:00
2021-02-22 19:40:41 +01:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00
2020-08-25 10:58:15 +02:00
2020-08-19 16:37:36 +02:00
2021-01-26 18:04:10 +01:00
2021-01-25 10:36:37 +01:00
2021-04-09 16:32:08 +02:00
2021-03-17 19:46:39 +01:00
2020-10-01 17:17:37 +02:00
2021-03-30 17:33:12 +02:00
2020-11-16 13:07:51 +01:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00
2021-02-22 19:40:41 +01:00
2019-02-18 14:50:57 +00:00
2020-09-09 15:17:11 +02:00
2020-09-09 15:18:05 +02:00
2020-09-09 15:18:05 +02:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00
2021-05-13 11:18:59 -06:00
2021-06-01 13:03:34 +02:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00
2020-12-07 16:47:02 +00:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00
2020-09-09 15:17:11 +02:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00
2021-04-28 13:54:16 +02:00
2021-02-02 12:52:18 +01:00
2020-11-13 09:17:16 +00:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00
2020-09-09 15:18:05 +02:00
2020-08-19 16:37:36 +02:00
2021-02-22 19:40:41 +01:00
2020-09-09 15:18:05 +02:00
2020-09-09 15:18:05 +02:00
2020-09-09 15:18:05 +02:00
2020-08-19 16:37:36 +02:00
2021-05-19 16:54:32 +02:00
2021-04-09 17:35:33 +02:00
2020-08-19 16:37:36 +02:00
2020-11-18 13:54:38 +01:00
2020-08-19 16:37:36 +02:00
2021-05-13 09:16:16 -04:00
2021-02-22 19:40:41 +01:00
2020-08-19 16:37:36 +02:00
2021-02-17 12:50:52 +00:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00
2020-08-25 10:58:15 +02:00
2020-12-08 21:00:17 +00:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00
2020-08-19 16:37:36 +02:00