diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2004-02-04 12:45:52 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2004-02-04 12:45:52 +0000 |
commit | 7e715711cc783c833bc64ea65732e5ffe129ba59 (patch) | |
tree | 95752b78c30e3476f8d0686d6a5e026775d93d7c /tools | |
parent | b33f7a7e8801b2b57d48e5a26505fd54cf20cf70 (diff) |
INTEGRATION: CWS ooo20031216 (1.6.2); FILE MERGED
2003/12/24 10:38:43 waratah 1.6.2.2: #i1858# work around for an unitialised warning in gcc
2003/12/23 13:26:37 waratah 1.6.2.1: #i1858# initialise some variables that may be unitialised when used
Reset the pTargetBuffer pointer to NULL when it is deleted, forcing deleted pointer error if one exists
Diffstat (limited to 'tools')
-rw-r--r-- | tools/source/inet/inetmime.cxx | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/tools/source/inet/inetmime.cxx b/tools/source/inet/inetmime.cxx index 5ae150d6e56b..6b4ea5edfd1a 100644 --- a/tools/source/inet/inetmime.cxx +++ b/tools/source/inet/inetmime.cxx @@ -2,9 +2,9 @@ * * $RCSfile: inetmime.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: rt $ $Date: 2003-12-01 18:03:53 $ + * last change: $Author: hr $ $Date: 2004-02-04 13:45:52 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -345,7 +345,7 @@ bool parseParameters(ParameterList const & rInput, for (Parameter * p = rInput.m_pList; p;) { bool bCharset = p->m_aCharset.Len() != 0; - rtl_TextEncoding eEncoding; + rtl_TextEncoding eEncoding = RTL_TEXTENCODING_DONTKNOW; if (bCharset) eEncoding = INetMIME::getCharsetEncoding(p->m_aCharset.GetBuffer(), @@ -2450,7 +2450,7 @@ void INetMIME::writeHeaderFieldBody(INetMIMEOutputSink & rSink, // not contain encoded-words): enum Entity { ENTITY_JUNK, ENTITY_NON_PHRASE, ENTITY_PHRASE }; - Entity eEntity; + Entity eEntity = ENTITY_JUNK; switch (*pBodyPtr) { case '.': @@ -3131,12 +3131,12 @@ UniString INetMIME::decodeHeaderFieldBody(HeaderFieldType eType, const sal_Char * q = p + 1; bool bEncodedWord = q != pEnd && *q++ == '?'; - rtl_TextEncoding eCharsetEncoding; + rtl_TextEncoding eCharsetEncoding = RTL_TEXTENCODING_DONTKNOW; if (bEncodedWord) { const sal_Char * pCharsetBegin = q; const sal_Char * pLanguageBegin = 0; - int nAlphaCount; + int nAlphaCount = 0; for (bool bDone = false; !bDone;) if (q == pEnd) { @@ -3191,7 +3191,7 @@ UniString INetMIME::decodeHeaderFieldBody(HeaderFieldType eType, } } - bool bEncodingB; + bool bEncodingB = false; if (bEncodedWord) if (q == pEnd) bEncodedWord = false; @@ -4024,8 +4024,8 @@ void INetMIMEEncodedWordOutputSink::finish(bool bWriteTrailer) // The non UTF-8 code will only work for stateless single byte // character encodings (see also below): - sal_Char * pTargetBuffer; - sal_Size nTargetSize; + sal_Char * pTargetBuffer = NULL; + sal_Size nTargetSize = 0; sal_uInt32 nSize; if (eMIMEEncoding == RTL_TEXTENCODING_UTF8) { @@ -4067,6 +4067,7 @@ void INetMIMEEncodedWordOutputSink::finish(bool bWriteTrailer) & RTL_UNICODETOTEXT_INFO_DESTBUFFERTOSMALL)) break; delete[] pTargetBuffer; + pTargetBuffer = NULL; rtl_resetUnicodeToTextContext(hConverter, hContext); } rtl_destroyUnicodeToTextContext(hConverter, hContext); |