#vulnerable code 
                                @Test
    public void testBase64() {
        String content = "Hello World";
        String encodedContent;
        byte[] encodedBytes = Base64.encodeBase64(StringUtils.getBytesUtf8(content));
        encodedContent = StringUtils.newStringUtf8(encodedBytes);
        assertTrue("encoding hello world", encodedContent.equals("SGVsbG8gV29ybGQ="));

        Base64 b64 = new Base64(BaseNCodec.MIME_CHUNK_SIZE, null);  // null lineSeparator same as saying no-chunking
        encodedBytes = b64.encode(StringUtils.getBytesUtf8(content));
        encodedContent = StringUtils.newStringUtf8(encodedBytes);
        assertTrue("encoding hello world", encodedContent.equals("SGVsbG8gV29ybGQ="));

        b64 = new Base64(0, null);  // null lineSeparator same as saying no-chunking
        encodedBytes = b64.encode(StringUtils.getBytesUtf8(content));
        encodedContent = StringUtils.newStringUtf8(encodedBytes);
        assertTrue("encoding hello world", encodedContent.equals("SGVsbG8gV29ybGQ="));

        // bogus characters to decode (to skip actually) {e-acute*6}
        byte[] decode = b64.decode("SGVsbG{\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9}8gV29ybGQ=");
        String decodeString = StringUtils.newStringUtf8(decode);
        assertTrue("decode hello world", decodeString.equals("Hello World"));        
    } 
                            #location 7 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                                @Test
    public void testBase64() {
        String content = "Hello World";
        String encodedContent;
        byte[] encodedBytes = Base64.encodeBase64(StringUtils.getBytesUtf8(content));
        encodedContent = StringUtils.newStringUtf8(encodedBytes);
        assertEquals("encoding hello world", "SGVsbG8gV29ybGQ=", encodedContent);

        Base64 b64 = new Base64(BaseNCodec.MIME_CHUNK_SIZE, null);  // null lineSeparator same as saying no-chunking
        encodedBytes = b64.encode(StringUtils.getBytesUtf8(content));
        encodedContent = StringUtils.newStringUtf8(encodedBytes);
        assertEquals("encoding hello world", "SGVsbG8gV29ybGQ=", encodedContent);

        b64 = new Base64(0, null);  // null lineSeparator same as saying no-chunking
        encodedBytes = b64.encode(StringUtils.getBytesUtf8(content));
        encodedContent = StringUtils.newStringUtf8(encodedBytes);
        assertEquals("encoding hello world", "SGVsbG8gV29ybGQ=", encodedContent);

        // bogus characters to decode (to skip actually) {e-acute*6}
        byte[] decode = b64.decode("SGVsbG{\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9}8gV29ybGQ=");
        String decodeString = StringUtils.newStringUtf8(decode);
        assertEquals("decode hello world", "Hello World", decodeString);        
    }