Adding some extra checks against bufer overflow

Change-Id: I08b53823792de363c7da22cda1db198b95242ba4
diff --git a/utils/misc/src/main/java/org/onlab/packet/DHCP.java b/utils/misc/src/main/java/org/onlab/packet/DHCP.java
index 79a39ef..a22f4d2 100644
--- a/utils/misc/src/main/java/org/onlab/packet/DHCP.java
+++ b/utils/misc/src/main/java/org/onlab/packet/DHCP.java
@@ -24,7 +24,8 @@
 import java.util.List;
 import java.util.ListIterator;
 
-import static org.onlab.packet.PacketUtils.*;
+import static com.google.common.base.Preconditions.checkArgument;
+import static org.onlab.packet.PacketUtils.checkInput;
 
 /**
  *
@@ -423,6 +424,8 @@
         bb.putInt(this.yourIPAddress);
         bb.putInt(this.serverIPAddress);
         bb.putInt(this.gatewayIPAddress);
+        checkArgument(this.clientHardwareAddress.length <= 16,
+                "Hardware address is too long (%s bytes)", this.clientHardwareAddress.length);
         bb.put(this.clientHardwareAddress);
         if (this.clientHardwareAddress.length < 16) {
             for (int i = 0; i < 16 - this.clientHardwareAddress.length; ++i) {