summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2017-10-05 13:48:19 +0900
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-10-05 13:48:20 +0900
commit1d4a1f6452dee50576e1511e07d208da418b2c6b (patch)
tree1353507b6a0aede5cc7da61a306cbd893332fbbd
parentMerge branch 'rs/cocci-de-paren-call-params' (diff)
parenttag: avoid NULL pointer arithmetic (diff)
downloadtgif-1d4a1f6452dee50576e1511e07d208da418b2c6b.tar.xz
Merge branch 'rs/tag-null-pointer-arith-fix'
Code clean-up. * rs/tag-null-pointer-arith-fix: tag: avoid NULL pointer arithmetic
-rw-r--r--tag.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tag.c b/tag.c
index 7e10acfb6e..fcbe012f7a 100644
--- a/tag.c
+++ b/tag.c
@@ -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;