From ec166aba55fdee739660dd11e293cd20f7a52cc1 Mon Sep 17 00:00:00 2001 From: christos Date: Wed, 22 Mar 2006 02:08:55 +0000 Subject: [PATCH] Coverity CID 199: make sure that rtp is not NULL before dereferencing. --- usr.bin/xlint/lint1/tree.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/usr.bin/xlint/lint1/tree.c b/usr.bin/xlint/lint1/tree.c index 192377a40473..201a80a440e1 100644 --- a/usr.bin/xlint/lint1/tree.c +++ b/usr.bin/xlint/lint1/tree.c @@ -1,4 +1,4 @@ -/* $NetBSD: tree.c,v 1.41 2005/04/07 16:28:40 christos Exp $ */ +/* $NetBSD: tree.c,v 1.42 2006/03/22 02:08:55 christos Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: tree.c,v 1.41 2005/04/07 16:28:40 christos Exp $"); +__RCSID("$NetBSD: tree.c,v 1.42 2006/03/22 02:08:55 christos Exp $"); #endif #include @@ -1184,9 +1184,9 @@ typeok(op_t op, int arg, tnode_t *ln, tnode_t *rn) if (mp->m_badeop && (ltp->t_isenum || (mp->m_binary && rtp->t_isenum))) { chkbeop(op, ln, rn); - } else if (mp->m_enumop && (ltp->t_isenum && rtp->t_isenum)) { + } else if (mp->m_enumop && (ltp->t_isenum && rtp && rtp->t_isenum)) { chkeop2(op, arg, ln, rn); - } else if (mp->m_enumop && (ltp->t_isenum || rtp->t_isenum)) { + } else if (mp->m_enumop && (ltp->t_isenum || (rtp && rtp->t_isenum))) { chkeop1(op, arg, ln, rn); }