On Tue, Apr 19, 2022 at 09:10:13AM -0600, Theo de Raadt wrote:
> - if ((buf->buf = malloc(len)) == NULL) {
> + if (len == 0)
> + buf->buf = NULL;
> + else if ((buf->buf = malloc(len)) == NULL) {
>
> This code intentionally permitted malloc(0), because with our malloc/free
> behaviour that will allocate a non-read/writeable object and a later access
> to it will nicely crash, exposing a bug.
Okay, in that case I keep it the way it is.
> Did you find any bugs in applications with the other ERANGE changes?
No, I have just spotted them while reading/understanding how the imsg
code works in detail.