src/share/classes/com/sun/jndi/dns/DnsClient.java

Print this page
rev 9296 : Detect compression loops in the JNDI DNS client

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -409,12 +409,11 @@
                     udpSocket.setSoTimeout(timeoutLeft);
                     long start = System.currentTimeMillis();
                     udpSocket.receive(ipkt);
                     long end = System.currentTimeMillis();
 
-                    byte[] data = new byte[ipkt.getLength()];
-                    data = ipkt.getData();
+                    byte[] data = ipkt.getData();
                     if (isMatchResponse(data, xid)) {
                         return data;
                     }
                     timeoutLeft = pktTimeout - ((int) (end - start));
                 } while (timeoutLeft > minTimeout);