summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2012-09-20 00:04:15 +0200
committerGravatar Martin Szulecki2012-11-07 22:19:26 +0100
commitfde8acd97fc9179960b89e86c3850f7803a3d35c (patch)
tree52b43d33fe6817dd07aa933455dc06b646bfbb3c
parentb5901c6e45e04e6c17c102225a60a4f29668f087 (diff)
downloadidevicerestore-fde8acd97fc9179960b89e86c3850f7803a3d35c.tar.gz
idevicerestore-fde8acd97fc9179960b89e86c3850f7803a3d35c.tar.bz2
Fix possible crash in error()
-rw-r--r--src/common.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/common.c b/src/common.c
index 0bd63be..f7ad7e6 100644
--- a/src/common.c
+++ b/src/common.c
@@ -51,13 +51,15 @@ void info(const char* format, ...)
void error(const char* format, ...)
{
- va_list vargs;
+ va_list vargs, vargs2;
va_start(vargs, format);
+ va_copy(vargs2, vargs);
vsnprintf(idevicerestore_err_buff, idevicerestore_err_buff_size, format, vargs);
+ va_end(vargs);
if (!error_disabled) {
- vfprintf((error_stream) ? error_stream : stderr, format, vargs);
+ vfprintf((error_stream) ? error_stream : stderr, format, vargs2);
}
- va_end(vargs);
+ va_end(vargs2);
}
void debug(const char* format, ...)