You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Ozgur Sahoglu (JIRA)" <xe...@xml.apache.org> on 2007/05/12 00:29:15 UTC

[jira] Created: (XERCESC-1702) The lib failes with Devide_By_zero error, when AliasForCharset is declared, but set to an empty value.

The lib failes with Devide_By_zero error, when AliasForCharset is declared, but set to an empty value.
------------------------------------------------------------------------------------------------------

                 Key: XERCESC-1702
                 URL: https://issues.apache.org/jira/browse/XERCESC-1702
             Project: Xerces-C++
          Issue Type: Bug
          Components: Utilities
    Affects Versions: 2.0.0, 2.1.0, 2.2.0, 2.3.0, 2.4.0, 2.5.0, 2.6.0, 2.7.0
         Environment: Windows XP (but I am sure this will fail for Cygwin as well).
            Reporter: Ozgur Sahoglu
             Fix For: 2.7.0


Steps to reproduce:
1. Open the registry editor in Windows (regedit.exe).
2. Goto HKEY_CLASSES_ROOT\MIME\DataBase\Charset\<any_charset>/AliasForCharset
3. Delete the Value Data, but don't delete the key
4. Run any app that uses Xerces-C

The problem is in src/xercesc/util/Transcoder/Win32/Win32TransService.cpp file. In version 2.7 goto line # 371:
const unsigned int targetLen = srcLen/charLen;

if charLen is 0, then you get Divide_By_zero exception.
I changed line #370
from 
if (charLen != -1) {
to
if (charLen > 0) {

to fix it.


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


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


[jira] Resolved: (XERCESC-1702) The lib failes with Devide_By_zero error, when AliasForCharset is declared, but set to an empty value.

Posted by "Alberto Massari (JIRA)" <xe...@xml.apache.org>.
     [ https://issues.apache.org/jira/browse/XERCESC-1702?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alberto Massari resolved XERCESC-1702.
--------------------------------------

    Resolution: Fixed

A fix is in SVN; please verify.

Alberto

> The lib failes with Devide_By_zero error, when AliasForCharset is declared, but set to an empty value.
> ------------------------------------------------------------------------------------------------------
>
>                 Key: XERCESC-1702
>                 URL: https://issues.apache.org/jira/browse/XERCESC-1702
>             Project: Xerces-C++
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 2.0.0, 2.1.0, 2.2.0, 2.3.0, 2.4.0, 2.5.0, 2.6.0, 2.7.0
>         Environment: Windows XP (but I am sure this will fail for Cygwin as well).
>            Reporter: Ozgur Sahoglu
>             Fix For: 2.7.0
>
>
> Steps to reproduce:
> 1. Open the registry editor in Windows (regedit.exe).
> 2. Goto HKEY_CLASSES_ROOT\MIME\DataBase\Charset\<any_charset>/AliasForCharset
> 3. Delete the Value Data, but don't delete the key
> 4. Run any app that uses Xerces-C
> The problem is in src/xercesc/util/Transcoder/Win32/Win32TransService.cpp file. In version 2.7 goto line # 371:
> const unsigned int targetLen = srcLen/charLen;
> if charLen is 0, then you get Divide_By_zero exception.
> I changed line #370
> from 
> if (charLen != -1) {
> to
> if (charLen > 0) {
> to fix it.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org