From 651ad453d360c61df0ccf1532099b04cb7cb09a2 Mon Sep 17 00:00:00 2001 From: Khaled Noaman <knoaman@apache.org> Date: Tue, 13 Jan 2004 13:43:29 +0000 Subject: [PATCH] Fix wrong size of allocation git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@175672 13f79535-47bb-0310-9956-ffa450edef68 --- .../util/Transcoders/Iconv390/Iconv390TransService.cpp | 4 ++-- src/xercesc/util/Transcoders/Win32/Win32TransService.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/xercesc/util/Transcoders/Iconv390/Iconv390TransService.cpp b/src/xercesc/util/Transcoders/Iconv390/Iconv390TransService.cpp index 03cce4330..94d79225d 100644 --- a/src/xercesc/util/Transcoders/Iconv390/Iconv390TransService.cpp +++ b/src/xercesc/util/Transcoders/Iconv390/Iconv390TransService.cpp @@ -1,7 +1,7 @@ /* * The Apache Software License, Version 1.1 * - * Copyright (c) 1999-2000 The Apache Software Foundation. All rights + * Copyright (c) 1999-2004 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without @@ -382,7 +382,7 @@ unsigned int Iconv390LCPTranscoder::calcRequiredSize(const XMLCh* const srcText if (wLent >= gTempBuffArraySize) wideCharBuf = allocatedArray = (wchar_t*) manager->allocate ( - (wLent + 1) * sizeof(wLent + 1) + (wLent + 1) * sizeof(wchar_t) );//new wchar_t[wLent + 1]; else wideCharBuf = tmpWideCharArr; diff --git a/src/xercesc/util/Transcoders/Win32/Win32TransService.cpp b/src/xercesc/util/Transcoders/Win32/Win32TransService.cpp index 06e11b0a3..6479badb4 100644 --- a/src/xercesc/util/Transcoders/Win32/Win32TransService.cpp +++ b/src/xercesc/util/Transcoders/Win32/Win32TransService.cpp @@ -1,7 +1,7 @@ /* * The Apache Software License, Version 1.1 * - * Copyright (c) 1999-2000 The Apache Software Foundation. All rights + * Copyright (c) 1999-2004 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without @@ -989,7 +989,7 @@ XMLCh* Win32LCPTranscoder::transcode(const char* const toTranscode, } else { - retVal = (XMLCh*) manager->allocate(sizeof(XMLCh*)); //new XMLCh[1]; + retVal = (XMLCh*) manager->allocate(sizeof(XMLCh)); //new XMLCh[1]; retVal[0] = 0; } return retVal; -- GitLab