Hanno Becker
0e810b9648
Don't call memcpy with NULL pointer in mbedtls_mpi_read_binary()
...
mbedtls_mpi_read_binary() calls memcpy() with the source pointer being
the source pointer passed to mbedtls_mpi_read_binary(), the latter may
be NULL if the buffer length is 0 (and this happens e.g. in the ECJPAKE
test suite). The behavior of memcpy(), in contrast, is undefined when
called with NULL source buffer, even if the length of the copy operation
is 0.
This commit fixes this by explicitly checking that the source pointer is
not NULL before calling memcpy(), and skipping the call otherwise.
2019-01-03 17:13:11 +00:00
..
2015-06-25 10:59:56 +02:00
2018-12-18 12:22:40 +01:00
2018-04-05 15:37:38 +02:00
2018-04-17 10:00:21 -05:00
2018-12-19 12:51:00 +00:00
2018-04-17 10:00:21 -05:00
2018-12-07 16:15:31 +00:00
2017-02-15 23:31:07 +02:00
2019-01-03 17:13:11 +00:00
2018-12-19 12:52:59 +00:00
2018-12-19 13:42:05 +00:00
2018-12-19 19:02:39 +01:00
2018-11-02 10:52:38 +00:00
2018-12-18 15:30:30 +00:00
2018-12-18 15:30:30 +00:00
2018-07-23 18:18:32 +01:00
2018-12-19 17:34:58 +01:00
2018-06-27 10:51:47 +01:00
2018-12-21 10:51:51 +00:00
2018-11-26 19:26:22 +01:00
2018-12-06 12:22:46 +00:00
2018-04-17 10:00:21 -05:00
2018-12-20 12:37:13 +00:00
2018-12-18 23:32:42 +00:00
2018-12-18 14:31:50 +00:00
2018-12-19 09:48:50 +00:00
2018-12-18 13:00:48 +00:00
2018-12-19 08:52:05 +00:00
2018-11-06 13:12:47 +00:00
2018-04-17 10:00:21 -05:00
2018-12-20 12:15:08 +00:00
2018-12-19 17:32:19 +01:00
2018-04-17 10:00:21 -05:00
2018-07-23 10:34:47 -07:00
2018-11-26 19:26:22 +01:00
2018-08-31 15:59:10 +01:00
2018-04-17 10:00:21 -05:00
2018-04-17 10:00:21 -05:00
2018-07-05 10:47:00 +02:00
2018-01-22 11:54:42 +01:00
2018-04-17 10:00:21 -05:00
2018-06-12 16:56:04 +01:00
2018-07-24 17:20:17 +01:00
2018-12-20 12:15:40 +01:00
2018-02-08 17:18:15 +08:00
2015-09-04 14:21:07 +02:00
2018-06-12 18:25:09 +03:00
2018-10-15 15:27:49 +02:00
2018-12-20 12:37:13 +00:00
2018-10-16 13:39:40 +01:00
2015-09-04 14:21:07 +02:00
2018-10-16 13:39:40 +01:00
2018-12-19 17:37:02 +01:00
2018-12-19 17:03:28 +01:00
2018-12-11 12:28:56 +01:00
2018-10-11 11:04:20 +01:00
2018-12-18 15:30:30 +00:00
2018-04-17 10:00:21 -05:00
2018-10-09 16:36:53 +01:00
2018-12-20 12:37:13 +00:00
2018-12-20 10:18:05 +00:00
2018-12-20 10:24:29 +00:00
2018-12-20 10:24:00 +00:00
2017-10-29 17:53:52 +02:00
2018-08-10 10:59:53 +01:00
2018-12-06 12:22:46 +00:00
2018-04-17 10:00:21 -05:00
2018-12-06 12:22:46 +00:00
2018-10-25 16:07:16 +01:00
2018-12-06 16:11:49 +00:00
2018-09-06 12:09:56 +01:00
2018-11-04 18:51:36 +00:00
2018-12-11 12:28:56 +01:00
2016-11-04 23:05:56 +01:00
2018-11-02 10:52:38 +00:00
2018-04-17 10:00:21 -05:00
2018-12-06 16:06:57 +00:00
2018-06-28 12:09:15 +01:00
2018-09-05 15:06:19 +01:00
2018-04-17 10:00:21 -05:00
2018-04-17 10:00:21 -05:00
2018-04-17 10:00:21 -05:00