Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(693)

Unified Diff: src/ports/SkDebug_android.cpp

Issue 394763004: Use va_list variable safely (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkDebug_android.cpp
diff --git a/src/ports/SkDebug_android.cpp b/src/ports/SkDebug_android.cpp
index 70029fbb6db965169e10a41db994d9175fa72bc4..b41abd309110bba5a0600344828548d0a2d6e97b 100644
--- a/src/ports/SkDebug_android.cpp
+++ b/src/ports/SkDebug_android.cpp
@@ -22,15 +22,17 @@ extern "C" void AndroidSkDebugToStdOut(bool debugToStdOut) {
}
void SkDebugf(const char format[], ...) {
- va_list args;
- va_start(args, format);
- __android_log_vprint(ANDROID_LOG_DEBUG, LOG_TAG, format, args);
+ va_list args1, args2;
+ va_start(args1, format);
+ va_copy(args2, args1);
+ __android_log_vprint(ANDROID_LOG_DEBUG, LOG_TAG, format, args1);
// Print debug output to stdout as well. This is useful for command
// line applications (e.g. skia_launcher)
if (gSkDebugToStdOut) {
- vprintf(format, args);
+ vprintf(format, args2);
}
- va_end(args);
+ va_end(args1);
+ va_end(args2);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698