除非該函數的控制參數設置為一個特定值,否則無法定義的行為。
The Linux Standard Base Specification 2.0.1 for libc 對一些內部函數的參數進行了限制 [1]。如果函數的參數不滿足這些約束條件,將無法定義函數的行為。
在下列 file system 函數中,值 1 必須傳遞給第一個參數(版本號):
__xmknod
2 必須傳遞給第三個參數(組參數):
__wcstod_internal
__wcstof_internal
_wcstol_internal
__wcstold_internal
__wcstoul_internal
3 必須作為第一參數(版本號)進行傳遞:
__xstat
__lxstat
__fxstat
__xstat64
__lxstat64
__fxstat64
[1] Standards Mapping - Common Weakness Enumeration - (CWE) CWE ID 475
[2] The Linux Standard Base Specification 2.0.1, Interfaces Definitions for libc.