git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Ramsay Jones <ramsay@ramsayjones.plus.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
	GIT Mailing-list <git@vger.kernel.org>
Subject: [PATCH] commit-graph: fix sparse 'NULL pointer' warning
Date: Sat, 23 Mar 2019 01:19:34 +0000	[thread overview]
Message-ID: <1908832c-8dd0-377e-917b-acb33b00273c@ramsayjones.plus.com> (raw)


Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
---

Hi Ævar,

If you need to re-roll your 'ab/commit-graph-fixes' branch, could you
please squash this into the relevant patch (commit aeb244adbc
("commit-graph: don't early exit(1) on e.g. \"git status\"", 2019-02-21).

This same commit (aeb244adbc) also removes the last call, outside of the
commit-graph.c file, to the function load_commit_graph_one(). So, this
function is now a file-local symbol and could be marked 'static'.

Also, the function verify_commit_graph_lite(), introduced in commit
d8acf37ff7 ("commit-graph: fix segfault on e.g. \"git status\"",
2019-02-21), currently has no external callers. This function is also
a file-local symbol and could be marked 'static', unless you have plans
for future external calls?

Thanks!

ATB,
Ramsay Jones

 commit-graph.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/commit-graph.c b/commit-graph.c
index 4696ee0036..680c6f5714 100644
--- a/commit-graph.c
+++ b/commit-graph.c
@@ -100,7 +100,7 @@ struct commit_graph *load_commit_graph_one_fd_st(int fd, struct stat *st)
 	if (graph_size < GRAPH_MIN_SIZE) {
 		close(fd);
 		error(_("commit-graph file is too small"));
-		return 0;
+		return NULL;
 	}
 	graph_map = xmmap(NULL, graph_size, PROT_READ, MAP_PRIVATE, fd, 0);
 	ret = parse_commit_graph(graph_map, fd, graph_size);
-- 
2.21.0

             reply	other threads:[~2019-03-23  1:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-23  1:19 Ramsay Jones [this message]
2019-03-25 12:02 ` [PATCH] commit-graph: fix sparse 'NULL pointer' warning Ævar Arnfjörð Bjarmason
2019-03-25 17:03   ` Ramsay Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1908832c-8dd0-377e-917b-acb33b00273c@ramsayjones.plus.com \
    --to=ramsay@ramsayjones.plus.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).