Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/lib/libc/stdio



    Date:        Sun, 31 Jan 2021 18:34:22 +0100
    From:        Joerg Sonnenberger <joerg%bec.de@localhost>
    Message-ID:  <YBbqHjwLNbNZJdDG%bec.de@localhost>

  | That makes no sense. Just turn them into a short read, which is
  | something users have to deal with anyway.

I'm not sure I agree with that one.   If the user's size * nmemb
overflows a size_t then the user is attempting something entirely
insane (they cannot possibly have a buffer that big).  Reading
anything at all is most probably the wrong thing to do, as the
args are very likely simply erroneous.   EINVAL is not an unreasonable
approach, I wouldn't even object to simply abort().

kre



Home | Main Index | Thread Index | Old Index