Update to 2.18.0-rc1
This commit is contained in:
parent
572ec3935e
commit
ce668b9d1e
@ -1,68 +0,0 @@
|
||||
From 3aa1681c8661b2f798277a55ab33ce7ba787288c Mon Sep 17 00:00:00 2001
|
||||
From: Elijah Newren <newren@gmail.com>
|
||||
Date: Wed, 23 May 2018 23:27:33 -0700
|
||||
Subject: [PATCH] rev-parse: check lookup'ed commit references for NULL
|
||||
|
||||
Commits 2122f8b963d4 ("rev-parse: Add support for the ^! and ^@ syntax",
|
||||
2008-07-26) and 3dd4e7320d ("Teach rev-parse the ... syntax.", 2006-07-04)
|
||||
taught rev-parse new syntax, and used lookup_commit_reference() as part of
|
||||
their logic. Neither usage checked the returned commit to see if it was
|
||||
non-NULL before using it. Check for NULL and ensure an appropriate error
|
||||
is reported to the user.
|
||||
|
||||
Reported by Florian Weimer and Todd Zullinger.
|
||||
|
||||
Helped-by: Jeff King <peff@peff.net>
|
||||
Signed-off-by: Elijah Newren <newren@gmail.com>
|
||||
---
|
||||
builtin/rev-parse.c | 8 ++++++--
|
||||
t/t6101-rev-parse-parents.sh | 8 ++++++++
|
||||
2 files changed, 14 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c
|
||||
index a1e680b5e9..a0a0ace38d 100644
|
||||
--- a/builtin/rev-parse.c
|
||||
+++ b/builtin/rev-parse.c
|
||||
@@ -282,6 +282,10 @@ static int try_difference(const char *arg)
|
||||
struct commit *a, *b;
|
||||
a = lookup_commit_reference(&start_oid);
|
||||
b = lookup_commit_reference(&end_oid);
|
||||
+ if (!a || !b) {
|
||||
+ *dotdot = '.';
|
||||
+ return 0;
|
||||
+ }
|
||||
exclude = get_merge_bases(a, b);
|
||||
while (exclude) {
|
||||
struct commit *commit = pop_commit(&exclude);
|
||||
@@ -328,12 +332,12 @@ static int try_parent_shorthands(const char *arg)
|
||||
return 0;
|
||||
|
||||
*dotdot = 0;
|
||||
- if (get_oid_committish(arg, &oid)) {
|
||||
+ if (get_oid_committish(arg, &oid) ||
|
||||
+ !(commit = lookup_commit_reference(&oid))) {
|
||||
*dotdot = '^';
|
||||
return 0;
|
||||
}
|
||||
|
||||
- commit = lookup_commit_reference(&oid);
|
||||
if (exclude_parent &&
|
||||
exclude_parent > commit_list_count(commit->parents)) {
|
||||
*dotdot = '^';
|
||||
diff --git a/t/t6101-rev-parse-parents.sh b/t/t6101-rev-parse-parents.sh
|
||||
index 8c617981a3..7683e4a114 100755
|
||||
--- a/t/t6101-rev-parse-parents.sh
|
||||
+++ b/t/t6101-rev-parse-parents.sh
|
||||
@@ -214,4 +214,12 @@ test_expect_success 'rev-list merge^-1x (garbage after ^-1)' '
|
||||
test_must_fail git rev-list merge^-1x
|
||||
'
|
||||
|
||||
+test_expect_success 'rev-parse $garbage^@ does not segfault' '
|
||||
+ test_must_fail git rev-parse $EMPTY_TREE^@
|
||||
+'
|
||||
+
|
||||
+test_expect_success 'rev-parse $garbage...$garbage does not segfault' '
|
||||
+ test_must_fail git rev-parse $EMPTY_TREE...$EMPTY_BLOB
|
||||
+'
|
||||
+
|
||||
test_done
|
12
git.spec
12
git.spec
@ -79,11 +79,11 @@
|
||||
%endif
|
||||
|
||||
# Define for release candidates
|
||||
%global rcrev .rc0
|
||||
%global rcrev .rc1
|
||||
|
||||
Name: git
|
||||
Version: 2.18.0
|
||||
Release: 0.0%{?rcrev}.1%{?dist}
|
||||
Release: 0.1%{?rcrev}%{?dist}
|
||||
Summary: Fast Version Control System
|
||||
License: GPLv2
|
||||
URL: https://git-scm.com/
|
||||
@ -120,12 +120,9 @@ Source99: print-failed-test-output
|
||||
Patch0: git-1.8-gitweb-home-link.patch
|
||||
# https://bugzilla.redhat.com/490602
|
||||
Patch1: git-cvsimport-Ignore-cvsps-2.2b1-Branches-output.patch
|
||||
# https://bugzilla.redhat.com/1581678
|
||||
# https://public-inbox.org/git/20180524062733.5412-1-newren@gmail.com/
|
||||
Patch2: 0001-rev-parse-check-lookup-ed-commit-references-for-NULL.patch
|
||||
# https://github.com/gitster/git/commit/f2cb01d35
|
||||
# https://public-inbox.org/git/20180601174644.13055-1-phillip.wood@talktalk.net/
|
||||
Patch3: 0001-add-p-fix-counting-empty-context-lines-in-edited-pat.patch
|
||||
Patch2: 0001-add-p-fix-counting-empty-context-lines-in-edited-pat.patch
|
||||
|
||||
%if %{with docs}
|
||||
BuildRequires: asciidoc >= 8.4.1
|
||||
@ -874,6 +871,9 @@ make test || ./print-failed-test-output
|
||||
%{?with_docs:%{_pkgdocdir}/git-svn.html}
|
||||
|
||||
%changelog
|
||||
* Mon Jun 04 2018 Todd Zullinger <tmz@pobox.com> - 2.18.0-0.1.rc1
|
||||
- Update to 2.18.0-rc1
|
||||
|
||||
* Fri Jun 01 2018 Todd Zullinger <tmz@pobox.com> - 2.18.0-0.0.rc0.1
|
||||
- add -p: fix counting empty context lines in edited patches
|
||||
|
||||
|
4
sources
4
sources
@ -1,2 +1,2 @@
|
||||
SHA512 (git-2.18.0.rc0.tar.xz) = 94ca43dfc2a9caa5d1a87d8f57558c7abc5ad4557705a0c3cf426f3720d09b9b45d2dc50f1238ddc69388238379addf3f59fd5fd21effd25376401263f0cdb7a
|
||||
SHA512 (git-2.18.0.rc0.tar.sign) = c0537a5e29ccbbc21a08d0bae22898111fcde9f863e018825454e0aa7e2449bf8ecc20ea0690e0ddcecc9616c9ab9d61a71b758d2a5b5075b80835fadda12030
|
||||
SHA512 (git-2.18.0.rc1.tar.xz) = b3910a0aa699785bbe75fa642105151889eecc79534509a64b32f0af192f9fbc9e546b0209b3ae2882ce46af7c45cea7ad1209e5655af708528712bd9c9049d3
|
||||
SHA512 (git-2.18.0.rc1.tar.sign) = b47d540d09ae16e6c3c7a8809027562302f3d41e5f687a5ea1ec4ba544b2eeb50d397a11b70d73ab36e8a77cadba4403ecbb8bb4f98ea0cafaa47d0694314980
|
||||
|
Loading…
Reference in New Issue
Block a user