diff options
author | Matthew Hatch <mrhatch97@gmail.com> | 2019-05-08 23:42:51 (GMT) |
---|---|---|
committer | Matthew Hatch <mrhatch97@gmail.com> | 2019-05-08 23:42:51 (GMT) |
commit | 90a4776f05cec29f816299d289c5f9cf0c523a69 (patch) | |
tree | c1fafcacca2eebcffa8ddf233654937f290b851a /src/message.cpp | |
parent | 80bcb700045047a67b580fd1c3df3f47992e2d64 (diff) | |
download | Doxygen-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.cpp | 6 |
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); |