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

Unified Diff: vm/os_macos.cc

Issue 10696165: Don't allow OS::SNPrint or OS::VSNPrint to return negative values. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 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 | « vm/os_linux.cc ('k') | vm/os_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/os_macos.cc
===================================================================
--- vm/os_macos.cc (revision 9556)
+++ vm/os_macos.cc (working copy)
@@ -128,7 +128,11 @@
int OS::VSNPrint(char* str, size_t size, const char* format, va_list args) {
- return vsnprintf(str, size, format, args);
+ int retval = vsnprintf(str, size, format, args);
+ if (retval < 0) {
+ FATAL1("Fatal error in OS::VSNPrint with format '%s'", format);
+ }
+ return retval;
}
« no previous file with comments | « vm/os_linux.cc ('k') | vm/os_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698