[PATCH 2/2] ctags: avoid null deref

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Protect the dereference of null base_type.

Reported-by: foobar <foobar@xxxxxxxxxx>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 ctags.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ctags.c b/ctags.c
index 9ec6b3c37..30976542d 100644
--- a/ctags.c
+++ b/ctags.c
@@ -135,7 +135,7 @@ static void examine_symbol(struct symbol *sym)
 
 	switch (sym->type) {
 	case SYM_NODE:
-		if (base->type == SYM_FN)
+		if (base && base->type == SYM_FN)
 			sym->kind = 'f';
 		examine_symbol(base);
 		break;
-- 
2.15.0

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux