mirror of
https://github.com/nillerusr/source-engine.git
synced 2026-08-07 17:29:36 +00:00
tier1: fix possible unsafe read in lzss SafeUncompress, make tests pass under asan
This commit is contained in:
@@ -606,6 +606,16 @@ typedef void * HINSTANCE;
|
||||
#define FMTFUNCTION( a, b )
|
||||
#endif
|
||||
|
||||
#if defined(__has_feature)
|
||||
#if __has_feature(address_sanitizer)
|
||||
#define USING_ASAN 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined( USING_ASAN ) && defined( __SANITIZE_ADDRESS__ )
|
||||
#define USING_ASAN 1
|
||||
#endif
|
||||
|
||||
#if COMPILER_CLANG || COMPILER_GCC
|
||||
#define NO_ASAN __attribute__((no_sanitize("address")))
|
||||
#else
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ public:
|
||||
unsigned char* CompressNoAlloc( const unsigned char *pInput, int inputlen, unsigned char *pOutput, unsigned int *pOutputSize );
|
||||
unsigned int Uncompress( const unsigned char *pInput, unsigned char *pOutput );
|
||||
//unsigned int Uncompress( unsigned char *pInput, CUtlBuffer &buf );
|
||||
unsigned int SafeUncompress( const unsigned char *pInput, unsigned char *pOutput, unsigned int unBufSize );
|
||||
unsigned int SafeUncompress( const unsigned char *pInput, unsigned int inputSize, unsigned char *pOutput, unsigned int unBufSize );
|
||||
|
||||
static bool IsCompressed( const unsigned char *pInput );
|
||||
static unsigned int GetActualSize( const unsigned char *pInput );
|
||||
|
||||
Reference in New Issue
Block a user