Skip to content

Commit 016c733

Browse files
committed
Add getenv to the list of unsafe functions
getenv() is bad: it returns a pointer to the environment, which might be changed by a following call to setenv(), making the value pointed to longer and leading to buffer overflows. See tarantool/tarantool#7807
1 parent 9479d77 commit 016c733

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

checkpatch.pl

+1
Original file line numberDiff line numberDiff line change
@@ -4922,6 +4922,7 @@ sub process {
49224922
if ($line =~ /\b($Ident)\s*\(/) {
49234923
my $func = $1;
49244924
my %func_list = (
4925+
"getenv" => "getenv_safe",
49254926
"sprintf" => "snprintf",
49264927
"vsprintf" => "vsnprintf",
49274928
"strcpy" => "strlcpy",

0 commit comments

Comments
 (0)