VALID() wasn't properly handling NULL returns, leading to false positives
This commit is contained in:
@@ -17,7 +17,11 @@ akerr_ErrorContext AKERR_ARRAY_ERROR[AKERR_MAX_ARRAY_ERROR];
|
||||
int akerr_valid_error_address(akerr_ErrorContext *ptr)
|
||||
{
|
||||
// Is this within the memory region occupied by AKERR_ARRAY_ERROR?
|
||||
return ((ptr >= &AKERR_ARRAY_ERROR[0]) && (ptr <= &AKERR_ARRAY_ERROR[AKERR_MAX_ARRAY_ERROR-1]));
|
||||
if ( ptr == NULL ) {
|
||||
return 1;
|
||||
}
|
||||
return ((ptr >= &AKERR_ARRAY_ERROR[0]) &&
|
||||
(ptr <= &AKERR_ARRAY_ERROR[AKERR_MAX_ARRAY_ERROR-1]));
|
||||
}
|
||||
|
||||
void akerr_default_logger(const char *fmt, ...)
|
||||
|
||||
Reference in New Issue
Block a user