login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
git
»
2008
»
September
»
24
Re: [PATCH] maint: check return of split_cmdline to avoid bad config strings
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Miklos Vajna
Subject:
Re: [PATCH] maint: check return of split_cmdline to avoid bad config strings
Date: Wednesday, September 24, 2008 - 2:28 am
On Wed, Sep 24, 2008 at 02:10:28AM -0400, Deskin Miller <deskinm@umich.edu>= wrote:
quoted text
> As the testcase demonstrates, it's possible to have split_cmdline return =
-1 and
quoted text
> deallocate any memory it's allocated, if the config string is missing an =
end
quoted text
> quote. In both the cases below, the return isn't checked, causing a pret=
ty
quoted text
> immediate segfault.
I think this could go to the commit message.
quoted text
> diff --git a/builtin-merge.c b/builtin-merge.c > index b280444..dcaf368 100644 > --- a/builtin-merge.c > +++ b/builtin-merge.c > @@ -442,6 +442,8 @@ static int git_merge_config(const char *k, const char=
*v, void *cb)
quoted text
> =20 > buf =3D xstrdup(v); > argc =3D split_cmdline(buf, &argv); > + if (argc < 0) > + die("Bad branch.%s.mergeoptions string", branch); > argv =3D xrealloc(argv, sizeof(*argv) * (argc + 2)); > memmove(argv + 1, argv, sizeof(*argv) * (argc + 1)); > argc++;
ACK.
quoted text
> diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh > index 64567fb..3794d23 100755 > --- a/t/t1300-repo-config.sh > +++ b/t/t1300-repo-config.sh > @@ -741,4 +741,14 @@ test_expect_success 'symlinked configuration' ' > =20 > ' > =20 > +test_expect_success 'check split_cmdline return' " > + git config alias.split-cmdline-fix 'echo \"' && > + git split-cmdline-fix || test $? =3D 128 && > + echo foo > foo && > + git add foo && > + git commit -m 'initial commit' && > + git config branch.master.mergeoptions 'echo \"' && > + git merge master || test $? =3D 128 > + "
Why don't you use test_must_fail here?
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH] maint: check return of split_cmdline to avoid bad ...
, Deskin Miller
, (Tue Sep 23, 11:10 pm)
Re: [PATCH] maint: check return of split_cmdline to avoid ...
, Miklos Vajna
, (Wed Sep 24, 2:28 am)
Re: [PATCH v2] maint: check return of split_cmdline to avo ...
, Deskin Miller
, (Wed Sep 24, 7:50 am)
Re: [PATCH v2] maint: check return of split_cmdline to avo ...
, Miklos Vajna
, (Wed Sep 24, 3:32 pm)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Stephen Smalley
Re: [AppArmor 39/45] AppArmor: Profile loading and manipulation, pathname matching
FUJITA Tomonori
Re: [Scst-devel] Integration of SCST in the mainstream Linux kernel
Borislav Petkov
drm_vm.c:drm_mmap: possible circular locking dependency detected (was: Re: Linux 2...
Michael Moore
Re: underage models, pre teen models, lolita porn, young preteens, little lolitas
Arnd Bergmann
Re: [PATCH] rcu: remove SPARSE_RCU_POINTER
git
:
Mike Miller
git message
Stefan Richter
Re: [kernel.org users] [RFD] On deprecating "git-foo" for builtins
Wincent Colaiuta
Re: [RFC PATCH] Make the rebase edit mode really end up in an edit state
Scott Chacon
Re: why not TortoiseGit
Michael Boutros
Git - index-pack missing
linux-netdev
:
Arnaldo Carvalho de Melo
Re: [PATCH 06/37] dccp: Limit feature negotiation to connection setup phase
Badalian Vyacheslav
Re: tc filter flow hash question
Parav Pandit
ip6 route output() and ip_route_output_key() by drivers
Sebastian Andrzej Siewior
[PATCH v2] net/core: use ntohs for skb->protocol
Jarek Poplawski
Re: tc filter flow hash question
git-commits-head
:
Linux Kernel Mailing List
mm: fix build on non-mmu machines
Linux Kernel Mailing List
i915: Don't whine when pci_enable_msi() fails.
Linux Kernel Mailing List
powerpc/kexec: Add support for FSL-BookE
Linux Kernel Mailing List
[ARM] 4671/1: ep93xx: remove obsolete gpio_line_* operations
Linux Kernel Mailing List
Staging: rt2870: Removal of kernel_thread() API
openbsd-misc
:
"RALOVICH, Kristóf"
Re: thinkpad windows refund
Kevin
Re: uvm_mapent_alloc: out of static map entries on 4.3 i386
Tony Abernethy
Re: The Atheros story in much fewer words
Nick Holland
Re: Install OpenBSD from USB ?
Daniel Ouellet
sysctl kern.maxproc help needed
Colocation donated by:
Syndicate