xerces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t..@apache.org
Subject cvs commit: xml-xerces/c/src/util/Transcoders/Iconv390 Iconv390TransService.cpp
Date Fri, 09 Mar 2001 21:31:03 GMT
tng         01/03/09 13:31:03

  Modified:    c/src/util/Transcoders/Iconv IconvTransService.cpp
               c/src/util/Transcoders/Iconv390 Iconv390TransService.cpp
  Log:
  [Bug 733] Changed - Seg fault when trying to parse empty filename
  
  Revision  Changes    Path
  1.21      +21 -17    xml-xerces/c/src/util/Transcoders/Iconv/IconvTransService.cpp
  
  Index: IconvTransService.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/util/Transcoders/Iconv/IconvTransService.cpp,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- IconvTransService.cpp	2000/09/21 00:54:19	1.20
  +++ IconvTransService.cpp	2001/03/09 21:31:02	1.21
  @@ -1,37 +1,37 @@
   /*
    * The Apache Software License, Version 1.1
  - * 
  + *
    * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
    * reserved.
  - * 
  + *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
  - * 
  + *
    * 1. Redistributions of source code must retain the above copyright
  - *    notice, this list of conditions and the following disclaimer. 
  - * 
  + *    notice, this list of conditions and the following disclaimer.
  + *
    * 2. Redistributions in binary form must reproduce the above copyright
    *    notice, this list of conditions and the following disclaimer in
    *    the documentation and/or other materials provided with the
    *    distribution.
  - * 
  + *
    * 3. The end-user documentation included with the redistribution,
  - *    if any, must include the following acknowledgment:  
  + *    if any, must include the following acknowledgment:
    *       "This product includes software developed by the
    *        Apache Software Foundation (http://www.apache.org/)."
    *    Alternately, this acknowledgment may appear in the software itself,
    *    if and wherever such third-party acknowledgments normally appear.
  - * 
  + *
    * 4. The names "Xerces" and "Apache Software Foundation" must
    *    not be used to endorse or promote products derived from this
  - *    software without prior written permission. For written 
  + *    software without prior written permission. For written
    *    permission, please contact apache\@apache.org.
  - * 
  + *
    * 5. Products derived from this software may not be called "Apache",
    *    nor may "Apache" appear in their name, without prior written
    *    permission of the Apache Software Foundation.
  - * 
  + *
    * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  @@ -45,7 +45,7 @@
    * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    * SUCH DAMAGE.
    * ====================================================================
  - * 
  + *
    * This software consists of voluntary contributions made by many
    * individuals on behalf of the Apache Software Foundation, and was
    * originally based on software copyright (c) 1999, International
  @@ -55,7 +55,7 @@
    */
   
   /*
  - * $Id: IconvTransService.cpp,v 1.20 2000/09/21 00:54:19 aruna1 Exp $
  + * $Id: IconvTransService.cpp,v 1.21 2001/03/09 21:31:02 tng Exp $
    */
   
   
  @@ -128,7 +128,7 @@
           wint_t wch2 = towupper(*cptr2);
           if (wch1 != wch2)
               break;
  -        
  +
           cptr1++;
           cptr2++;
       }
  @@ -150,7 +150,7 @@
           wint_t wch2 = towupper(*cptr2);
           if (wch1 != wch2)
               break;
  -        
  +
           cptr1++;
           cptr2++;
           n++;
  @@ -288,7 +288,7 @@
   
           // Calc the needed size.
           const size_t neededLen = ::wcstombs(NULL, wideCharBuf, 0);
  -        if (neededLen == 0)
  +        if (neededLen == -1)
           {
               delete [] allocatedArray;
               return 0;
  @@ -362,7 +362,11 @@
       {
           const unsigned int len = calcRequiredSize(toTranscode);
           if (len == 0)
  -            return 0;
  +        {
  +            retVal = new XMLCh[1];
  +            retVal[0] = 0;
  +            return retVal;
  +        }
   
           wchar_t       tmpWideCharArr[gTempBuffArraySize];
           wchar_t*      allocatedArray = 0;
  
  
  
  1.9       +7 -2      xml-xerces/c/src/util/Transcoders/Iconv390/Iconv390TransService.cpp
  
  Index: Iconv390TransService.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/util/Transcoders/Iconv390/Iconv390TransService.cpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Iconv390TransService.cpp	2000/07/25 22:31:14	1.8
  +++ Iconv390TransService.cpp	2001/03/09 21:31:03	1.9
  @@ -55,7 +55,7 @@
    */
   
   /*
  - * $Id: Iconv390TransService.cpp,v 1.8 2000/07/25 22:31:14 aruna1 Exp $
  + * $Id: Iconv390TransService.cpp,v 1.9 2001/03/09 21:31:03 tng Exp $
    */
   
   
  @@ -453,7 +453,12 @@
       {
           const unsigned int len = calcRequiredSize(toTranscode);
           if (len == 0)
  -            return 0;
  +        {
  +            retVal = new XMLCh[1];
  +            retVal[0] = 0;
  +            return retVal;
  +        }
  +
   
           wchar_t       tmpWideCharArr[gTempBuffArraySize];
           wchar_t*      allocatedArray = 0;
  
  
  

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


Mime
View raw message