From b418c55e89494f1142270dad4401b404e649c997 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 2 Feb 2020 14:31:59 +0100 Subject: [PATCH] Verify tiny int printing input. --- server/TracyPrint.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/TracyPrint.cpp b/server/TracyPrint.cpp index 1ac02d74..bab42ae6 100644 --- a/server/TracyPrint.cpp +++ b/server/TracyPrint.cpp @@ -32,6 +32,7 @@ static const char* IntTable100 = static inline void PrintTinyInt( char*& buf, uint64_t v ) { + assert( v < 100 ); if( v >= 10 ) { *buf++ = '0' + v/10; @@ -41,6 +42,7 @@ static inline void PrintTinyInt( char*& buf, uint64_t v ) static inline void PrintTinyInt0( char*& buf, uint64_t v ) { + assert( v < 100 ); if( v >= 10 ) { *buf++ = '0' + v/10; @@ -54,6 +56,7 @@ static inline void PrintTinyInt0( char*& buf, uint64_t v ) static inline void PrintSmallInt( char*& buf, uint64_t v ) { + assert( v < 1000 ); if( v >= 100 ) { memcpy( buf, IntTable100 + v/10*2, 2 );