summaryrefslogtreecommitdiffstats
path: root/src/message.cpp
diff options
context:
space:
mode:
authorMatthew Hatch <mrhatch97@gmail.com>2019-05-08 23:42:51 (GMT)
committerMatthew Hatch <mrhatch97@gmail.com>2019-05-08 23:42:51 (GMT)
commit90a4776f05cec29f816299d289c5f9cf0c523a69 (patch)
treec1fafcacca2eebcffa8ddf233654937f290b851a /src/message.cpp
parent80bcb700045047a67b580fd1c3df3f47992e2d64 (diff)
downloadDoxygen-90a4776f05cec29f816299d289c5f9cf0c523a69.zip
Doxygen-90a4776f05cec29f816299d289c5f9cf0c523a69.tar.gz
Doxygen-90a4776f05cec29f816299d289c5f9cf0c523a69.tar.bz2
Fixed segmentation fault in do_warn
Copied va_list to avoid reuse causing crash
Diffstat (limited to 'src/message.cpp')
-rw-r--r--src/message.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/message.cpp b/src/message.cpp
index 2e3e41a..ddf757a 100644
--- a/src/message.cpp
+++ b/src/message.cpp
@@ -167,6 +167,10 @@ static void format_warn(const char *file,int line,const char *text)
static void do_warn(bool enabled, const char *file, int line, const char *prefix, const char *fmt, va_list args)
{
if (!enabled) return; // warning type disabled
+
+ va_list argsCopy;
+ va_copy(argsCopy, args);
+
int l=0;
if (prefix)
{
@@ -182,7 +186,7 @@ static void do_warn(bool enabled, const char *file, int line, const char *prefix
{
qstrncpy(text,prefix,bufSize);
}
- vsnprintf(text+l, bufSize-l, fmt, args);
+ vsnprintf(text+l, bufSize-l, fmt, argsCopy);
text[bufSize-1]='\0';
format_warn(file,line,text);
free(text);