mirror of
https://github.com/git/git.git
synced 2026-03-01 18:24:00 +01:00
Merge branch 'cx/fetch-display-ubfix' into next
Undefined-behaviour fix in "git fetch". * cx/fetch-display-ubfix: fetch: fix wrong evaluation order in URL trailing-slash trimming
This commit is contained in:
@@ -721,7 +721,7 @@ static void display_state_init(struct display_state *display_state, struct ref *
|
||||
display_state->url = xstrdup("foreign");
|
||||
|
||||
display_state->url_len = strlen(display_state->url);
|
||||
for (i = display_state->url_len - 1; display_state->url[i] == '/' && 0 <= i; i--)
|
||||
for (i = display_state->url_len - 1; 0 <= i && display_state->url[i] == '/'; i--)
|
||||
;
|
||||
display_state->url_len = i + 1;
|
||||
if (4 < i && !strncmp(".git", display_state->url + i - 3, 4))
|
||||
|
||||
Reference in New Issue
Block a user