diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-05-31 19:10:35 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-05-31 19:10:35 -0700 |
commit | db5b7c3e462a327e07c451d8a6e41b2ba193a1f8 (patch) | |
tree | bbfbff91730463c853b0e2338ca127a3ff8e7f81 /dir.c | |
parent | 1bcf4f6271ad8c952739164d160e97efd579424f (diff) | |
parent | 2acf4cf0010379f10b39eba1fb4e0868a5ba4114 (diff) | |
download | git-db5b7c3e462a327e07c451d8a6e41b2ba193a1f8.tar.gz |
Merge branch 'js/ci-gcc-12-fixes'
Fixes real problems noticed by gcc 12 and works around false
positives.
* js/ci-gcc-12-fixes:
dir.c: avoid "exceeds maximum object size" error with GCC v12.x
nedmalloc: avoid new compile error
compat/win32/syslog: fix use-after-realloc
Diffstat (limited to 'dir.c')
-rw-r--r-- | dir.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -3138,6 +3138,15 @@ char *git_url_basename(const char *repo, int is_bundle, int is_bare) } /* + * It should not be possible to overflow `ptrdiff_t` by passing in an + * insanely long URL, but GCC does not know that and will complain + * without this check. + */ + if (end - start < 0) + die(_("No directory name could be guessed.\n" + "Please specify a directory on the command line")); + + /* * Strip trailing port number if we've got only a * hostname (that is, there is no dir separator but a * colon). This check is required such that we do not |