From: Junio C Hamano Date: Thu, 14 Aug 2008 01:36:53 GMT Subject: Re: [PATCH] Allow emails with boundaries to work again Message-ID: <7vtzdogyx6.fsf@gitster.siamese.dyndns.org> In-Reply-To: <1218667559-26618-1-git-send-email-dzickus@redhat.com> Don Zickus writes: > Recent changes to is_multipart_boundary() caused git-mailinfo to segfault. > The reason was after handling the end of the boundary the code tried to look > for another boundary. Because the boundary list was empty, dereferencing > the pointer to the top of the boundary caused the program to go boom. > > The fix is to check to see if the list is empty and if so go on its merry > way instead of looking for another boundary. Hmm, at this point !*content_top means that we are at the outermost level and we have just seen --boundary-- which is the terminating one, haven't we? Shouldn't we be simply returning?