]> git.cameronkatri.com Git - cgit.git/commitdiff
ui-log: ban strcpy()
authorChristian Hesse <mail@eworm.de>
Tue, 28 Aug 2018 16:08:33 +0000 (18:08 +0200)
committerChristian Hesse <mail@eworm.de>
Tue, 11 Sep 2018 06:47:12 +0000 (08:47 +0200)
Git upstream bans strcpy() with commit:

  automatically ban strcpy()
  c8af66ab8ad7cd78557f0f9f5ef6a52fd46ee6dd

Signed-off-by: Christian Hesse <mail@eworm.de>
ui-log.c

index d696e20706770d120892d0073ce05fe7532b762e..c2f92febc2ee67f91872a82c2b43018d6599a78b 100644 (file)
--- a/ui-log.c
+++ b/ui-log.c
@@ -234,7 +234,7 @@ static void print_commit(struct commit *commit, struct rev_info *revs)
                        strbuf_add(&msgbuf, "\n\n", 2);
 
                        /* Place wrap_symbol at position i in info->subject */
                        strbuf_add(&msgbuf, "\n\n", 2);
 
                        /* Place wrap_symbol at position i in info->subject */
-                       strcpy(info->subject + i, wrap_symbol);
+                       strlcpy(info->subject + i, wrap_symbol, subject_len - i + 1);
                }
        }
        cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head,
                }
        }
        cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head,