summaryrefslogtreecommitdiff
path: root/transport.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-02-05 16:12:32 -0800
committerJunio C Hamano <gitster@pobox.com>2013-02-05 16:12:33 -0800
commit8278a7bdc19fb917860788dcff5a34c0f629dd0b (patch)
treeb4c551e6fcab84075ce35700a1910c16b87ea9fa /transport.c
parentf51a757fafc1e1ca9565381a13109932acd81dba (diff)
parent1d2c14df1605a05118524b2382402d689f69d737 (diff)
downloadgit-8278a7bdc19fb917860788dcff5a34c0f629dd0b.tar.gz
Merge branch 'ft/transport-report-segv'
A failure to push due to non-ff while on an unborn branch dereferenced a NULL pointer when showing an error message. * ft/transport-report-segv: push: fix segfault when HEAD points nowhere
Diffstat (limited to 'transport.c')
-rw-r--r--transport.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/transport.c b/transport.c
index 384ff9acf1..886ffd8b1e 100644
--- a/transport.c
+++ b/transport.c
@@ -752,7 +752,7 @@ void transport_print_push_status(const char *dest, struct ref *refs,
ref->status != REF_STATUS_OK)
n += print_one_push_status(ref, dest, n, porcelain);
if (ref->status == REF_STATUS_REJECT_NONFASTFORWARD) {
- if (!strcmp(head, ref->name))
+ if (head != NULL && !strcmp(head, ref->name))
*reject_reasons |= REJECT_NON_FF_HEAD;
else
*reject_reasons |= REJECT_NON_FF_OTHER;