[Crosstoolchain-logs] [device-tree-compiler] 23/58: dtc: pos parameter to srcpos_string() can't be NULL

Vagrant Cascadian vagrant at moszumanska.debian.org
Mon Sep 25 16:23:46 UTC 2017


This is an automated email from the git hooks/post-receive script.

vagrant pushed a commit to branch debian/master
in repository device-tree-compiler.

commit 00d7bb1f4b0e3578c69c126fa6c50a7897c4524f
Author: David Gibson <david at gibson.dropbear.id.au>
Date:   Wed Feb 8 17:39:36 2017 +1100

    dtc: pos parameter to srcpos_string() can't be NULL
    
    None of the callers ever pass a NULL to srcpos_string(), so the check
    for it is not necessary.  Furthermore, checking it make Coverity complain
    about the raw dereferences which follow later in the function.
    
    Signed-off-by: David Gibson <david at gibson.dropbear.id.au>
---
 srcpos.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpos.c b/srcpos.c
index aa3aad0..9d38459 100644
--- a/srcpos.c
+++ b/srcpos.c
@@ -252,7 +252,7 @@ srcpos_string(struct srcpos *pos)
 	const char *fname = "<no-file>";
 	char *pos_str;
 
-	if (pos)
+	if (pos->file && pos->file->name)
 		fname = pos->file->name;
 
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/crosstoolchain/device-tree-compiler.git



More information about the Crosstoolchain-logs mailing list