public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Matthieu Moy <Matthieu.Moy@grenoble-inp•fr>
To: Eric Sunshine <sunshine@sunshineco•com>
Cc: Tanay Abhra <tanayabh@gmail•com>, Git List <git@vger•kernel.org>,
	Ramkumar Ramachandra <artagnon@gmail•com>
Subject: Re: [PATCH] pretty.c: make git_pretty_formats_config return -1 on git_config_string failure
Date: Mon, 04 Aug 2014 21:49:51 +0200	[thread overview]
Message-ID: <vpqy4v4avc0.fsf@anie.imag.fr> (raw)
In-Reply-To: <CAPig+cRo05mG9yeU61VSjAvXWRHU9soaaH-Cv7MKoxZ=it15Rw@mail.gmail.com> (Eric Sunshine's message of "Mon, 4 Aug 2014 14:56:03 -0400")

Eric Sunshine <sunshine@sunshineco•com> writes:

> On Mon, Aug 4, 2014 at 11:45 AM, Matthieu Moy
> <Matthieu.Moy@grenoble-inp•fr> wrote:
>> Tanay Abhra <tanayabh@gmail•com> writes:
>>
>>> `git_pretty_formats_config()` continues without checking git_config_string's
>>> return value which can lead to a SEGFAULT.
>>
>> Indeed, without the patch:
>>
>> $ git -c pretty.my= log --pretty=my
>> error: Missing value for 'pretty.my'
>> zsh: segmentation fault  git -c pretty.my= log --pretty=my
>
> This probably should be formalized as a proper test and included with
> Tanay's patch.

Not sure it's worth the trouble: the bug corresponds to a
mis-application of a pattern used in tens of places in Git's code
(basically, each call to git_config_string, 50 callsites). Testing this
particular case does not ensure non-regression, and testing all
occurences of the pattern would be overkill IMHO.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

  reply	other threads:[~2014-08-04 19:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-04 14:41 [PATCH] pretty.c: make git_pretty_formats_config return -1 on git_config_string failure Tanay Abhra
2014-08-04 15:45 ` Matthieu Moy
2014-08-04 18:56   ` Eric Sunshine
2014-08-04 19:49     ` Matthieu Moy [this message]
2014-08-04 20:33   ` Jeff King
2014-08-04 21:06     ` Matthieu Moy
2014-08-04 21:56       ` [PATCH] config: teach "git -c" to recognize an empty string Jeff King
2014-08-04 22:25         ` Junio C Hamano

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=vpqy4v4avc0.fsf@anie.imag.fr \
    --to=matthieu.moy@grenoble-inp$(echo .)fr \
    --cc=artagnon@gmail$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=sunshine@sunshineco$(echo .)com \
    --cc=tanayabh@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox