diff options
author | Oleg Besedin | 2008-04-10 18:29:58 +0000 |
---|---|---|
committer | Oleg Besedin | 2008-04-10 18:29:58 +0000 |
commit | 1dc2c5ad0c836c62035b326fa112aa6feb12b16d (patch) | |
tree | cbef61f90f8ea1dc89a9b928075058f24dde14a3 /bundles/org.eclipse.equinox.security.tests | |
parent | 2020718d7b0943405eb0dcb80a65abb410cb26a7 (diff) | |
download | rt.equinox.bundles-1dc2c5ad0c836c62035b326fa112aa6feb12b16d.tar.gz rt.equinox.bundles-1dc2c5ad0c836c62035b326fa112aa6feb12b16d.tar.xz rt.equinox.bundles-1dc2c5ad0c836c62035b326fa112aa6feb12b16d.zip |
Bug 226579 Array out of bounds in Base64
Diffstat (limited to 'bundles/org.eclipse.equinox.security.tests')
-rw-r--r-- | bundles/org.eclipse.equinox.security.tests/src/org/eclipse/equinox/internal/security/tests/storage/Base64Test.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/bundles/org.eclipse.equinox.security.tests/src/org/eclipse/equinox/internal/security/tests/storage/Base64Test.java b/bundles/org.eclipse.equinox.security.tests/src/org/eclipse/equinox/internal/security/tests/storage/Base64Test.java index 05ec66746..5e2aa3a68 100644 --- a/bundles/org.eclipse.equinox.security.tests/src/org/eclipse/equinox/internal/security/tests/storage/Base64Test.java +++ b/bundles/org.eclipse.equinox.security.tests/src/org/eclipse/equinox/internal/security/tests/storage/Base64Test.java @@ -36,6 +36,9 @@ public class Base64Test extends TestCase { final private static String decoded5 = "1.234"; final private static String encoded5 = "M\05S4y\tM\n\rzQ=\r\n"; // tests invalid characters + final private static String decoded6 = "a"; + final private static String encoded6 = "YQ=="; // tests array bounds + public Base64Test() { super(); } @@ -63,6 +66,10 @@ public class Base64Test extends TestCase { byte[] bytesInvalidChars = EncodingUtils.decodeBase64(encoded5); String decodedInvalidChars = new String(bytesInvalidChars); assertEquals(decoded5, decodedInvalidChars); + + String shortSample = EncodingUtils.encodeBase64(decoded6.getBytes()); + assertEquals(encoded6, shortSample); + assertEquals(decoded6, new String(EncodingUtils.decodeBase64(shortSample))); } /** |