Ben Wagner a9793feace [base] Avoid UB with memcpy
`FT_NEW_ARRAY(p, 0)` sets `p` to `NULL`. `FT_Stream_ReadAt` with a
memory based stream uses `FT_MEM_COPY` which is `memcpy` which specifies
that it is undefined behavior for either the `src` or `dst` to be
`NULL`. Instead of forcing all callers work around calling
`FT_Stream_Read` when `buffer == NULL && count == 0` do the check in
`FT_StreamRead`. This allows any call with `count == 0` to succesfully
read zero bytes without UB.

* src/base/ftstream.c (FT_Stream_ReadAt): skip `FT_MEM_COPY` when
`count == 0`. (FT_Stream_TryRead): ditto

Fixes: #1250
2023-08-17 13:25:31 -04:00
..
2023-08-17 13:25:31 -04:00
2023-05-23 13:18:01 +02:00
2023-05-12 22:27:08 -04:00
2023-07-14 18:58:55 +02:00
2023-06-24 08:11:05 +02:00
2023-06-03 06:09:30 +02:00
2023-02-08 21:09:32 +01:00
2023-01-17 09:18:25 +01:00
2023-05-07 16:42:01 +02:00
2023-05-07 15:57:06 +02:00
2023-05-07 20:26:12 +02:00
2023-05-23 13:18:01 +02:00
2023-07-28 22:35:58 -04:00