diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-10-18 14:19:12 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-10-18 14:19:12 +0900 |
commit | 073a1fd9e4005091a6f37e2a57221218a115fabd (patch) | |
tree | 5802556d0f07d1933e3423f650eccddb8a43b0ac | |
parent | ff35d2a9984189d6c92399004fd6a7bc4bd7c769 (diff) | |
parent | 7099153e8d7d0ed228c3a63cb06912c13c1082e5 (diff) | |
download | git-073a1fd9e4005091a6f37e2a57221218a115fabd.tar.gz git-073a1fd9e4005091a6f37e2a57221218a115fabd.tar.xz |
Merge branch 'rs/tag-null-pointer-arith-fix' into maint
Code clean-up.
* rs/tag-null-pointer-arith-fix:
tag: avoid NULL pointer arithmetic
-rw-r--r-- | tag.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -142,13 +142,13 @@ int parse_tag_buffer(struct tag *item, const void *data, unsigned long size) bufptr = nl + 1; if (!strcmp(type, blob_type)) { - item->tagged = &lookup_blob(&oid)->object; + item->tagged = (struct object *)lookup_blob(&oid); } else if (!strcmp(type, tree_type)) { - item->tagged = &lookup_tree(&oid)->object; + item->tagged = (struct object *)lookup_tree(&oid); } else if (!strcmp(type, commit_type)) { - item->tagged = &lookup_commit(&oid)->object; + item->tagged = (struct object *)lookup_commit(&oid); } else if (!strcmp(type, tag_type)) { - item->tagged = &lookup_tag(&oid)->object; + item->tagged = (struct object *)lookup_tag(&oid); } else { error("Unknown type %s", type); item->tagged = NULL; |