diff options
| author | Chris Costello <chris@FreeBSD.org> | 2002-01-06 21:48:37 +0000 |
|---|---|---|
| committer | Chris Costello <chris@FreeBSD.org> | 2002-01-06 21:48:37 +0000 |
| commit | 6ba681a1854880e15fa843ea0b062594a6aa6662 (patch) | |
| tree | 3ea05da8701202d27cce4300323bdb8f9c40dda8 /lib/libc/stdio/fgets.3 | |
| parent | e125c135a88a6a1995006a1c03a8ebfcd7179c7c (diff) | |
Notes
Diffstat (limited to 'lib/libc/stdio/fgets.3')
| -rw-r--r-- | lib/libc/stdio/fgets.3 | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/lib/libc/stdio/fgets.3 b/lib/libc/stdio/fgets.3 index 9c3ecea3d3a6..511d1185b587 100644 --- a/lib/libc/stdio/fgets.3 +++ b/lib/libc/stdio/fgets.3 @@ -137,9 +137,14 @@ The .Fn gets function cannot be used securely. Because of its lack of bounds checking, +and the inability for the calling program +to reliably determine the length of the next incoming line, the use of this function enables malicious users to arbitrarily change a running program's functionality through a buffer overflow attack. +It is strongly suggested that the +.Fn fgets +function be used in all cases. (See the FSA.) .Sh SEE ALSO @@ -157,16 +162,3 @@ and .Fn gets conform to .St -isoC . -.Sh BUGS -Since it is usually impossible to ensure that the next input line -is less than some arbitrary length, and because overflowing the -input buffer is almost invariably a security violation, programs -should -.Em NEVER -use -.Fn gets . -The -.Fn gets -function -exists purely to conform to -.St -isoC . |
