aboutsummaryrefslogtreecommitdiff
path: root/refs.h
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2017-10-15 22:06:52 +0000
committerJunio C Hamano <gitster@pobox.com>2017-10-16 11:05:50 +0900
commit6ee18216d8d9ca8f76b01282b36bdf590a64d8fc (patch)
treeb29f5705e7051ef1e4e6841765517894b5184bf0 /refs.h
parentae077771b09fac4d663e3f8c039318a97eb3a15b (diff)
downloadgit-6ee18216d8d9ca8f76b01282b36bdf590a64d8fc.tar.gz
git-6ee18216d8d9ca8f76b01282b36bdf590a64d8fc.tar.xz
refs: prevent accidental NULL dereference in write_pseudoref
Several of the refs functions take NULL to indicate that the ref is not to be updated. If refs_update_ref were called with a NULL new object ID, we could pass that NULL pointer to write_pseudoref, which would then segfault when it dereferenced it. Instead, simply return successfully, since if we don't want to update the pseudoref, there's nothing to do. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.h')
0 files changed, 0 insertions, 0 deletions