Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Merge branch 'ft/transport-report-segv' into maint
author
Junio C Hamano
<gitster@pobox.com>
Thu, 7 Feb 2013 23:15:08 +0000
(15:15 -0800)
committer
Junio C Hamano
<gitster@pobox.com>
Thu, 7 Feb 2013 23:15:08 +0000
(15:15 -0800)
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
transport.c
patch
|
blob
|
history
raw
(from parent 1:
d2216a4
)
diff --git
a/transport.c
b/transport.c
index 9932f402dfee2605dbb498b120813aebaa3961f8..b9306ef64543d4eb705354ac170d9acc7b735ec5 100644
(file)
--- a/
transport.c
+++ b/
transport.c
@@
-741,7
+741,7
@@
void transport_print_push_status(const char *dest, struct ref *refs,
n += print_one_push_status(ref, dest, n, porcelain);
if (ref->status == REF_STATUS_REJECT_NONFASTFORWARD &&
*nonfastforward != NON_FF_HEAD) {
- if (!strcmp(head, ref->name))
+ if (
head != NULL &&
!strcmp(head, ref->name))
*nonfastforward = NON_FF_HEAD;
else
*nonfastforward = NON_FF_OTHER;