This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]


In article <> (at 12 May 2001 00:23:59 -0400), James Antill <> says:

>  My guess  would that that either something is going wrong somewhere
> else and chopping the end of your data off, or you are running against
> an older version of libc that doesn't have the second check converted
> from a >= to > (the last line of context in your patch).

oops, sorry, ok at this point.  But,

>  I sent in a patch for the second test below a while ago (Message-ID:
> <>) and thought about the first test (the
> one you are supplying a patch for) but I couldn't think of how a
> cmsghdr could only be the size of a cmsghdr?
>  The header itself only contains:
> length
> level
> type

RFC2292 implies we should accept the case which cmsg message without data.

|    #define CMSG_NXTHDR(mhdr, cmsg) \
|        ( ((cmsg) == NULL) ? CMSG_FIRSTHDR(mhdr) : \
|          (((u_char *)(cmsg) + ALIGN((cmsg)->cmsg_len) \
|                             + ALIGN(sizeof(struct cmsghdr)) > \
|            (u_char *)((mhdr)->msg_control) + (mhdr)->msg_controllen) ? \
|           (struct cmsghdr *)NULL : \
|           (struct cmsghdr *)((u_char *)(cmsg) + ALIGN((cmsg)->cmsg_len))) )

Glibc ignores last chunk without data.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]