]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'jk/commit-sign-overflow-fix'
authorJunio C Hamano <gitster@pobox.com>
Thu, 21 May 2026 23:48:20 +0000 (08:48 +0900)
committerJunio C Hamano <gitster@pobox.com>
Thu, 21 May 2026 23:48:20 +0000 (08:48 +0900)
Leakfix.

* jk/commit-sign-overflow-fix:
  commit: handle large commit messages in utf8 verification

1  2 
commit.c

diff --cc commit.c
index f7ea9d99282503958e305901b35ce041d56bde92,cd49aada40747ce69245c04e454e26bb9b8e5d61..e3e7352e69682d45e5b9ef609c656674fc03cb13
+++ b/commit.c
@@@ -1642,13 -1642,13 +1642,13 @@@ static bool has_invalid_utf8(const cha
   * If it isn't, it assumes any non-utf8 characters are Latin1,
   * and does the conversion.
   */
 -static int verify_utf8(struct strbuf *buf)
 +static int ensure_utf8(struct strbuf *buf)
  {
        int ok = 1;
-       long pos = 0;
+       size_t pos = 0;
  
        for (;;) {
-               int bad;
+               size_t bad;
                unsigned char c;
                unsigned char replace[2];