fgets.3 (32eef9aeb1f39a1623cea55da147c89abbd5b9a5) fgets.3 (e125c135a88a6a1995006a1c03a8ebfcd7179c7c)
1.\" Copyright (c) 1990, 1991, 1993
2.\" The Regents of the University of California. All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" Chris Torek and the American National Standards Committee X3,
6.\" on Information Processing Systems.
7.\"
8.\" Redistribution and use in source and binary forms, with or without

--- 118 unchanged lines hidden (view full) ---

127.Xr malloc 3 .
128.Pp
129The function
130.Fn gets
131may also fail and set
132.Va errno
133for any of the errors specified for the routine
134.Xr getchar 3 .
1.\" Copyright (c) 1990, 1991, 1993
2.\" The Regents of the University of California. All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" Chris Torek and the American National Standards Committee X3,
6.\" on Information Processing Systems.
7.\"
8.\" Redistribution and use in source and binary forms, with or without

--- 118 unchanged lines hidden (view full) ---

127.Xr malloc 3 .
128.Pp
129The function
130.Fn gets
131may also fail and set
132.Va errno
133for any of the errors specified for the routine
134.Xr getchar 3 .
135.Sh SECURITY CONSIDERATIONS
136The
137.Fn gets
138function cannot be used securely.
139Because of its lack of bounds checking,
140the use of this function enables malicious users
141to arbitrarily change a running program's functionality through
142a buffer overflow attack.
143(See
144the FSA.)
135.Sh SEE ALSO
136.Xr feof 3 ,
137.Xr ferror 3 ,
138.Xr fgetln 3
145.Sh SEE ALSO
146.Xr feof 3 ,
147.Xr ferror 3 ,
148.Xr fgetln 3
149.Rs
150.%T "The FreeBSD Security Architecture"
151.%J "/usr/share/doc/{to be determined}"
152.Re
139.Sh STANDARDS
140The functions
141.Fn fgets
142and
143.Fn gets
144conform to
145.St -isoC .
146.Sh BUGS

--- 12 unchanged lines hidden ---
153.Sh STANDARDS
154The functions
155.Fn fgets
156and
157.Fn gets
158conform to
159.St -isoC .
160.Sh BUGS

--- 12 unchanged lines hidden ---