Check for NULL pointer in ecdev_receive().
authorFlorian Pose <fp@igh-essen.com>
Tue, 11 Aug 2009 12:15:20 +0000
changeset 1521 2180c608e250
parent 1520 09cf61d61af0
child 1522 cb57736b5508
child 1763 48c1f14b696b
Check for NULL pointer in ecdev_receive().
master/device.c
--- a/master/device.c	Thu Aug 06 12:52:53 2009 +0000
+++ b/master/device.c	Tue Aug 11 12:15:20 2009 +0000
@@ -506,6 +506,12 @@
 {
     const void *ec_data = data + ETH_HLEN;
     size_t ec_size = size - ETH_HLEN;
+
+    if (unlikely(!data)) {
+        EC_WARN("%s() called with NULL data.\n", __func__);
+        return;
+    }
+
     device->rx_count++;
 
     if (unlikely(device->master->debug_level > 1)) {