[freenet-cvs] r13757 - trunk/freenet/src/freenet/support

2007-06-26 Thread [email protected]
Author: sback
Date: 2007-06-26 09:48:37 + (Tue, 26 Jun 2007)
New Revision: 13757

Modified:
   trunk/freenet/src/freenet/support/HexUtil.java
Log:
Added a control (which can raise an exception) over the 
hexToBytes(String,byte[],int) last argument value

Modified: trunk/freenet/src/freenet/support/HexUtil.java
===
--- trunk/freenet/src/freenet/support/HexUtil.java  2007-06-26 09:15:57 UTC 
(rev 13756)
+++ trunk/freenet/src/freenet/support/HexUtil.java  2007-06-26 09:48:37 UTC 
(rev 13757)
@@ -80,6 +80,10 @@
 */
public static final void hexToBytes(String s, byte[] out, int off)
throws NumberFormatException, IndexOutOfBoundsException {
+   
+   if (off >= out.length)
+   throw new IllegalArgumentException();
+   
int slen = s.length();
if ((slen % 2) != 0) {
s = '0' + s;




[freenet-cvs] r13757 - trunk/freenet/src/freenet/support

2007-06-26 Thread sback
Author: sback
Date: 2007-06-26 09:48:37 + (Tue, 26 Jun 2007)
New Revision: 13757

Modified:
   trunk/freenet/src/freenet/support/HexUtil.java
Log:
Added a control (which can raise an exception) over the 
hexToBytes(String,byte[],int) last argument value

Modified: trunk/freenet/src/freenet/support/HexUtil.java
===
--- trunk/freenet/src/freenet/support/HexUtil.java  2007-06-26 09:15:57 UTC 
(rev 13756)
+++ trunk/freenet/src/freenet/support/HexUtil.java  2007-06-26 09:48:37 UTC 
(rev 13757)
@@ -80,6 +80,10 @@
 */
public static final void hexToBytes(String s, byte[] out, int off)
throws NumberFormatException, IndexOutOfBoundsException {
+   
+   if (off >= out.length)
+   throw new IllegalArgumentException();
+   
int slen = s.length();
if ((slen % 2) != 0) {
s = '0' + s;

___
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs