I was going through an old install of Courier-IMAP, and found a patch
I hade mad way back when (to courier-imap-0.27) at what is now
rfc2045.c:495.  I changed:

    if ((newp->mime_version=strdup(p->mime_version)) == 0)
        rfc2045_enomem();

to

    if (p->mime_version) {
        if ((newp->mime_version=strdup(p->mime_version)) == 0)
            rfc2045_enomem();
        } else {
            newp->mime_version=NULL;
        }

to fix a crash a user was seeing with no mime-version header, or an
empty one, or a malformed one, or something...I can't reproduce the
problem with the latest version (I no longer have the message that
caused the problem), but I couldn't find an obvious guarantee that
this line of code would never be reached with p->mime_version set to
NULL.

Is there some reason why this is guaranteed never to happen, or should
a check for NULL be put in?

-----ScottG.


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to