]> git.cameronkatri.com Git - cgit.git/blobdiff - ui-log.c
ui-ssdiff: resolve HTML5 validation errors
[cgit.git] / ui-log.c
index b5cd2f61d3305f15f4201e8faa4bca1b93b4864c..3bcb657657e47265ffe499910a7508ad9323287f 100644 (file)
--- a/ui-log.c
+++ b/ui-log.c
@@ -67,7 +67,7 @@ void show_commit_decorations(struct commit *commit)
        while (deco) {
                struct object_id peeled;
                int is_annotated = 0;
-               strncpy(buf, prettify_refname(deco->name), sizeof(buf) - 1);
+               strlcpy(buf, prettify_refname(deco->name), sizeof(buf));
                switch(deco->type) {
                case DECORATION_NONE:
                        /* If the git-core doesn't recognize it,
@@ -153,8 +153,8 @@ static int show_commit(struct commit *commit, struct rev_info *revs)
        rem_lines = 0;
 
        revs->diffopt.flags.recursive = 1;
-       diff_tree_oid(&parent->tree->object.oid,
-                     &commit->tree->object.oid,
+       diff_tree_oid(&parent->maybe_tree->object.oid,
+                     &commit->maybe_tree->object.oid,
                      "", &revs->diffopt);
        diffcore_std(&revs->diffopt);
 
@@ -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 */
-                       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,