From c7e32a16ec02af351276a1ec677975ba99e705f4 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 26 Jul 2019 23:07:10 +0200 Subject: [PATCH] Assert on invalid file names. --- server/TracyStorage.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/TracyStorage.cpp b/server/TracyStorage.cpp index 082ab570..e2a5d1bd 100644 --- a/server/TracyStorage.cpp +++ b/server/TracyStorage.cpp @@ -87,6 +87,8 @@ static void GetConfigDirectory( char* buf, size_t& sz ) const char* GetSavePath( const char* file ) { + assert( file && *file ); + enum { Pool = 8 }; enum { MaxPath = 512 }; static char bufpool[Pool][MaxPath]; @@ -112,6 +114,9 @@ const char* GetSavePath( const char* file ) const char* GetSavePath( const char* program, uint64_t time, const char* file, bool create ) { + assert( file && *file ); + assert( program && *program ); + enum { Pool = 8 }; enum { MaxPath = 512 }; static char bufpool[Pool][MaxPath];