From: "Juan F. Codagnone" <jcodagnone@gmail.com>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] mailinfo: avoid segfault when can't open files
Date: Wed, 24 Jan 2018 13:51:31 -0300 [thread overview]
Message-ID: <CALfSDjd0oZZmz1nKzasKu-Adn3LPS+AdLH4mYeR=Rx-PZpe4Jw@mail.gmail.com> (raw)
In-Reply-To: <20180124040232.GB1330@sigill.intra.peff.net>
On Wed, Jan 24, 2018 at 1:02 AM, Jeff King <peff@peff.net> wrote:
>
> On Tue, Jan 23, 2018 at 11:54:17PM -0300, Juan F. Codagnone wrote:
...
>
>
> But given the lack of callers, it may not be worth the effort. So I'm OK
> with this solution. It may be worth giving an abbreviated version of the
> above explanation in the commit message. Perhaps:
>
> If <msg> or <patch> files can't be opened, then mailinfo() returns an
> error before it even initializes mi->p_hdr_data or mi->s_hdr_data.
> When cmd_mailinfo() then calls clear_mailinfo(), we dereference the
> NULL pointers trying to free their contents.
>
> As for the patch itself, it looks correct but I saw two style nits:
Thanks for the detailed review! I'm sorry about the style nits. I
focused on the tabs and braces. Next time I will take additional
attention.
I'll be resubmitting the patch taking into account your remarks.
next prev parent reply other threads:[~2018-01-24 16:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-24 2:54 [PATCH] mailinfo: avoid segfault when can't open files Juan F. Codagnone
2018-01-24 4:02 ` Jeff King
2018-01-24 16:51 ` Juan F. Codagnone [this message]
2018-01-24 18:06 ` Jeff King
2018-01-24 16:56 ` [PATCH v1] " Juan F. Codagnone
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CALfSDjd0oZZmz1nKzasKu-Adn3LPS+AdLH4mYeR=Rx-PZpe4Jw@mail.gmail.com' \
--to=jcodagnone@gmail.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).