From 9a54b8d78e9d63987379206a0cbc856c46a2ef44 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Tue, 4 Feb 2014 18:52:05 +0100 Subject: Fix potential NULL dereference Found by Coverity. * i386/i386at/com.c (comopen): On com_reprobe() returning success, check for `isai' again. --- i386/i386at/com.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'i386/i386at') diff --git a/i386/i386at/com.c b/i386/i386at/com.c index 8f293af..e1ba71a 100644 --- a/i386/i386at/com.c +++ b/i386/i386at/com.c @@ -338,6 +338,8 @@ io_return_t comopen( */ if (!com_reprobe(unit)) return D_NO_SUCH_DEVICE; + if ((isai = cominfo[unit]) == 0 || isai->alive == 0) + return D_NO_SUCH_DEVICE; } tp = &com_tty[unit]; -- cgit v1.2.3