diff options
author | Matthias Andree <matthias.andree@gmx.de> | 2008-06-13 16:20:49 +0000 |
---|---|---|
committer | Matthias Andree <matthias.andree@gmx.de> | 2008-06-13 16:20:49 +0000 |
commit | 99113547e733f876cc2f8dfbe8412ed7e082d479 (patch) | |
tree | ddf9fbff3262a8a25a8cbcea49fb605f64e1f4e9 /report.c | |
parent | 592f3edea03f19d8c682d9f3d9c4c05028c15a77 (diff) | |
download | fetchmail-99113547e733f876cc2f8dfbe8412ed7e082d479.tar.gz fetchmail-99113547e733f876cc2f8dfbe8412ed7e082d479.tar.bz2 fetchmail-99113547e733f876cc2f8dfbe8412ed7e082d479.zip |
Fix Novell Bug #354291, fetchmail crashes in -v -v mode when logging long To:
headers (in excess of 2048 bytes).
svn path=/branches/BRANCH_6-3/; revision=5193
Diffstat (limited to 'report.c')
-rw-r--r-- | report.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -238,11 +238,17 @@ report_build (FILE *errfp, message, va_alist) rep_ensuresize(); #if defined(VA_START) - VA_START (args, message); for ( ; ; ) { + /* + * args has to be initialized before every call of vsnprintf(), + * because vsnprintf() invokes va_arg macro and thus args is + * undefined after the call. + */ + VA_START(args, message); n = vsnprintf (partial_message + partial_message_size_used, partial_message_size - partial_message_size_used, message, args); + va_end (args); if (n >= 0 && (unsigned)n < partial_message_size - partial_message_size_used) @@ -254,7 +260,6 @@ report_build (FILE *errfp, message, va_alist) partial_message_size += 2048; partial_message = REALLOC (partial_message, partial_message_size); } - va_end (args); #else for ( ; ; ) { |