Skip to content

Commit ded8393

Browse files
mhaggergitster
authored andcommitted
check_aliased_update(): check that dst_name is non-NULL
If there is an error in resolve_ref_unsafe(), it returns NULL. We check for this case, but not until after calling strip_namespace(). Instead, call strip_namespace() *after* the NULL check. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: David Turner <dturner@twopensource.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent be7651a commit ded8393

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/receive-pack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1081,13 +1081,13 @@ static void check_aliased_update(struct command *cmd, struct string_list *list)
10811081
if (!(flag & REF_ISSYMREF))
10821082
return;
10831083

1084-
dst_name = strip_namespace(dst_name);
10851084
if (!dst_name) {
10861085
rp_error("refusing update to broken symref '%s'", cmd->ref_name);
10871086
cmd->skip_update = 1;
10881087
cmd->error_string = "broken symref";
10891088
return;
10901089
}
1090+
dst_name = strip_namespace(dst_name);
10911091

10921092
if ((item = string_list_lookup(list, dst_name)) == NULL)
10931093
return;

0 commit comments

Comments
 (0)