mirror of
https://github.com/git/git.git
synced 2024-11-19 09:33:59 +01:00
Merge branch 'rs/tag-null-pointer-arith-fix' into maint
Code clean-up. * rs/tag-null-pointer-arith-fix: tag: avoid NULL pointer arithmetic
This commit is contained in:
commit
073a1fd9e4
8
tag.c
8
tag.c
@ -142,13 +142,13 @@ int parse_tag_buffer(struct tag *item, const void *data, unsigned long size)
|
|||||||
bufptr = nl + 1;
|
bufptr = nl + 1;
|
||||||
|
|
||||||
if (!strcmp(type, blob_type)) {
|
if (!strcmp(type, blob_type)) {
|
||||||
item->tagged = &lookup_blob(&oid)->object;
|
item->tagged = (struct object *)lookup_blob(&oid);
|
||||||
} else if (!strcmp(type, tree_type)) {
|
} 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)) {
|
} 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)) {
|
} else if (!strcmp(type, tag_type)) {
|
||||||
item->tagged = &lookup_tag(&oid)->object;
|
item->tagged = (struct object *)lookup_tag(&oid);
|
||||||
} else {
|
} else {
|
||||||
error("Unknown type %s", type);
|
error("Unknown type %s", type);
|
||||||
item->tagged = NULL;
|
item->tagged = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user