On Sun, Feb 24, 2019 at 07:06:40PM +0000, Michael van Elst wrote:
> While here, also check for arithmetic overflow.


> +     /* how much to actually read */
> +     rawbufmax = callerbytes + skipstart;
> +     if (rawbufmax < callerbytes)
> +             return EINVAL;

hmm, I"m under the impression that checking for overflow without
upsetting the compiler is a delicate matter.

something like the overflow is undefined behaviour, so it cannot
happen, so the branch checking that it happened is eliminated.

Reply via email to