From 71a30642aa9b15d6730d8fcafa461fdeddba55ca Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sat, 31 Jan 2009 02:28:52 +0000 Subject: started to port bsd tundevice to new ifconfig feature removed possible null pointer derefernce --- src/linux/tunDevice.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/linux/tunDevice.cpp') diff --git a/src/linux/tunDevice.cpp b/src/linux/tunDevice.cpp index 8fde8ae..8ab7ff8 100644 --- a/src/linux/tunDevice.cpp +++ b/src/linux/tunDevice.cpp @@ -127,6 +127,9 @@ int TunDevice::write(u_int8_t* buf, u_int32_t len) if(fd_ < 0) return -1; + if(!buf) + return 0; + if(with_pi_) { struct iovec iov[2]; -- cgit v1.2.3