logo       

[jira] Resolved: (XERCESJ-1257) buffer overflow in UTF8Reader for character: msg#00006

Subject: [jira] Resolved: (XERCESJ-1257) buffer overflow in UTF8Reader for characters out of BMP
     [ 
https://issues.apache.org/jira/browse/XERCESJ-1257?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Glavassevich resolved XERCESJ-1257.
-------------------------------------------

    Resolution: Fixed

Robert, though your patch does avoid the AIOOBE, it would still allow the 
Reader to write outside the region of the char buffer it was asked to write 
into.  Happens if length < ch.length. I committed a different fix [1] which 
handles this case, writes the high surrogate into the char buffer (since 
there's still space for it) and saves the low surrogate for the next read.  You 
should be able to verify it with one of the regular Gump builds [2]. Look for a 
jar dated after July 6th.  It might take a day or two to show up there.

[1] http://marc.info/?l=xerces-cvs&m=118375899720046&w=2
[2] http://vmgump.apache.org/gump/public-jars/xml-xerces2/jars/

> buffer overflow in UTF8Reader for characters out of BMP
> -------------------------------------------------------
>
>                 Key: XERCESJ-1257
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1257
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: JAXP (javax.xml.parsers)
>    Affects Versions: 2.9.0
>         Environment: Any
>            Reporter: Robert Stojnic
>            Assignee: Michael Glavassevich
>            Priority: Minor
>         Attachments: TestXerces.java, UTF8Reader.patch
>
>
> There is a ArrayOutOfBoundsException in org.apache.xerces.impl.io.UTF8Reader, 
> in read(char[],int,int) for 4-byte utf-8 chars.
> Imagine a following scenario. read() has a buffer of size N, and it reads N-1 
> ascii chars, and stores it in the output buffer. Let the Nth char be the 
> first byte of a 4 byte utf-8 char. The other 3 bytes are fetched by invoking 
> read() on the input stream. From these a surrogate pair of java chars is 
> made, however, method does not check if both chars can fit into the output 
> buffer ... In most cases, they would fit into the ouput buffer (e.g. if there 
> are some other multi-byte chars in the fetched text), so the bug is very 
> rare, but it still happens.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
boot-loaders.gr...    php.pear.genera...    debugging.valgr...    kde.redhat.user...    text.xml.xsl.ge...    culture.languag...    hardware.microc...    java.servicemix...    redhat.release....    web.zope.plone....    user-groups.lin...    opendarwin.webk...    video.mjpeg.use...    sysutils.bcfg2....    encryption.gpg....    lx-office.devel...    xfree86.forum/2...    mail.mutt.devel...    acpi.devel/2003...    qnx.openqnx.dev...    network.irc.irs...    freebsd.devel.m...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe