mirror of
https://github.com/falcosecurity/falco.git
synced 2026-04-07 20:42:39 +00:00
This defines certain functions as invalid tokens, i.e., when compiled, the compiler throws an error. Currently only `strcpy` is included as a banned function. Fixes #788 Signed-off-by: Vaibhav <vrongmeal@gmail.com>
26 lines
841 B
C
26 lines
841 B
C
/*
|
|
Copyright (C) 2019 The Falco Authors.
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
// BAN macro defines `function` as an invalid token that says using
|
|
// the function is banned. This throws a compile time error when the
|
|
// function is used.
|
|
#define BAN(function) using_##function##_is_banned
|
|
|
|
#undef strcpy
|
|
#define strcpy(a, b) BAN(strcpy)
|