From: malaterre Date: Sun, 14 Nov 2004 00:53:10 +0000 (+0000) Subject: BUG: All va_start should be close by a va_end in the same function. Thanks to Dennis... X-Git-Tag: Version1.0.bp~609 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=69d0ad06856167fb277b1bcfdb79912d986268c5;hp=eae9a01c2edd9f615a78dc64a8e7731d09e815a1;p=gdcm.git BUG: All va_start should be close by a va_end in the same function. Thanks to Dennis Hudr (sina.com) for reporting bug. --- diff --git a/src/gdcmUtil.cxx b/src/gdcmUtil.cxx index d0359f8b..9c096bea 100644 --- a/src/gdcmUtil.cxx +++ b/src/gdcmUtil.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmUtil.cxx,v $ Language: C++ - Date: $Date: 2004/11/10 18:27:24 $ - Version: $Revision: 1.61 $ + Date: $Date: 2004/11/14 00:53:10 $ + Version: $Revision: 1.62 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -50,6 +50,9 @@ std::string Util::Format(const char* format, ...) va_list args; va_start(args, format); vsprintf(buffer, format, args); //might be a security flaw + va_end(args); // Each invocation of va_start should be matched + // by a corresponding invocation of va_end + // args is then 'undefined' return buffer; } @@ -241,8 +244,6 @@ std::string Util::GetCurrentTime() return tmp; } - - /** * \ingroup Util * \brief Create a /DICOM/ string: @@ -285,7 +286,6 @@ std::ostream& binary_write(std::ostream& os, const uint32_t& val) #endif //GDCM_WORDS_BIGENDIAN } -//template <> std::ostream& binary_write(std::ostream& os, const char* val) { return os.write(val, strlen(val)); @@ -296,6 +296,5 @@ std::ostream& binary_write(std::ostream& os, std::string const & val) return os.write(val.c_str(), val.size()); } - } // end namespace gdcm