diff options
author | Janne Grunau <janne-libav@jannau.net> | 2012-10-26 20:26:29 +0200 |
---|---|---|
committer | Janne Grunau <janne-libav@jannau.net> | 2012-11-25 23:02:04 +0100 |
commit | e96d90eed66a198566c409958432d282e1b03869 (patch) | |
tree | e22240bf2fe017cc2c1a679df61a303275e66760 /libavutil/internal.h | |
parent | 610e00b3594bf0f2a75713f20e9c4edf0d03a818 (diff) | |
download | ffmpeg-e96d90eed66a198566c409958432d282e1b03869.tar.gz |
remove #defines to prevent use of discouraged external functions
Preventing the use of discouraged or 'insecure' external functions
through defines in an internal header is not a good solution. The
header is not guaranteed to be included universally which makes
overlooking bad use of said functions during review more likely.
There are cases were those functions either are the most straight
forward solution or even have to be used. Using malloc or free is
required if the allocation or release is done by other libraries.
Diffstat (limited to 'libavutil/internal.h')
-rw-r--r-- | libavutil/internal.h | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/libavutil/internal.h b/libavutil/internal.h index 9fd105145c..f0f5a635c8 100644 --- a/libavutil/internal.h +++ b/libavutil/internal.h @@ -57,40 +57,6 @@ # define INT_BIT (CHAR_BIT * sizeof(int)) #endif -/* avoid usage of dangerous/inappropriate system functions */ -#undef malloc -#define malloc please_use_av_malloc -#undef free -#define free please_use_av_free -#undef realloc -#define realloc please_use_av_realloc -#undef time -#define time time_is_forbidden_due_to_security_issues -#undef rand -#define rand rand_is_forbidden_due_to_state_trashing_use_av_lfg_get -#undef srand -#define srand srand_is_forbidden_due_to_state_trashing_use_av_lfg_init -#undef random -#define random random_is_forbidden_due_to_state_trashing_use_av_lfg_get -#undef sprintf -#define sprintf sprintf_is_forbidden_due_to_security_issues_use_snprintf -#undef strcat -#define strcat strcat_is_forbidden_due_to_security_issues_use_av_strlcat -#undef exit -#define exit exit_is_forbidden -#undef printf -#define printf please_use_av_log_instead_of_printf -#undef fprintf -#define fprintf please_use_av_log_instead_of_fprintf -#undef puts -#define puts please_use_av_log_instead_of_puts -#undef perror -#define perror please_use_av_log_instead_of_perror -#undef strcasecmp -#define strcasecmp please_use_av_strcasecmp -#undef strncasecmp -#define strncasecmp please_use_av_strncasecmp - #define FF_ALLOC_OR_GOTO(ctx, p, size, label)\ {\ p = av_malloc(size);\ |