[e-lang] Joe-E taming error in java.lang.String.taming

Tyler Close tyler.close at gmail.com
Sat Sep 22 09:19:09 EDT 2007


So now that I've tamed away all the string encoding methods from
java.lang.String, I find I need another method in the
org.joe_e.charset.ASCII API. In particular,

    /**
     * Decodes a US-ASCII string.
     * @return The corresponding string
     */
    static public String
    decode(final byte[] buffer, final int off, final int len) {
        try {
            return new String(buffer, off, len, "US-ASCII");
        } catch (final UnsupportedEncodingException e) {
            // This should never happen, as US-ASCII is a required encoding
            throw new AssertionError("US-ASCII encoding not supported");
        }
    }

--Tyler

On 9/21/07, Adrian Mettler <amettler at cs.berkeley.edu> wrote:
> Tyler Close wrote:
> > The current taming file for java.lang.String allows the methods:
> >
> > getBytes(java.lang.String)
> > getBytes()
> >
> > Both of these leak information about the platform and provide access
> > to non-determinism. The org.joe_e.charset API should be used instead.
> >
> > --Tyler
> >
>
> Good catch.  I should emphasize that the current taming database as
> posted is just a small shade better than meaningless, however; it
> consists of little more than everything from String (which I included
> without looking it over very carefully, primarily to test the
> infrastructure).
>
> I'll make sure to keep this in mind when I do a more careful and
> thorough job of taming java.lang for the safej ("real") version of the
> taming database.
>
> -Adrian
> _______________________________________________
> e-lang mailing list
> e-lang at mail.eros-os.org
> http://www.eros-os.org/mailman/listinfo/e-lang
>


-- 
The web-calculus is the union of REST and capability-based security:
http://www.waterken.com/dev/Web/

Name your trusted sites to distinguish them from phishing sites.
https://addons.mozilla.org/firefox/957/


More information about the e-lang mailing list