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 --- 16 unchanged lines hidden (view full) --- 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.\" @(#)strcat.3 8.1 (Berkeley) 6/4/93 |
33.\" $FreeBSD: head/lib/libc/string/strcat.3 208027 2010-05-13 12:07:55Z uqs $ |
34.\" 35.Dd December 1, 2009 36.Dt STRCAT 3 37.Os 38.Sh NAME 39.Nm strcat , 40.Nm strncat 41.Nd concatenate strings --- 33 unchanged lines hidden (view full) --- 75.Sh RETURN VALUES 76The 77.Fn strcat 78and 79.Fn strncat 80functions 81return the pointer 82.Fa s . |
83.Sh SEE ALSO 84.Xr bcopy 3 , 85.Xr memccpy 3 , 86.Xr memcpy 3 , 87.Xr memmove 3 , 88.Xr strcpy 3 , 89.Xr strlcat 3 , 90.Xr strlcpy 3 , 91.Xr wcscat 3 92.Sh STANDARDS 93The 94.Fn strcat 95and 96.Fn strncat 97functions 98conform to 99.St -isoC . |
100.Sh SECURITY CONSIDERATIONS 101The 102.Fn strcat 103function is easily misused in a manner 104which enables malicious users to arbitrarily change 105a running program's functionality through a buffer overflow attack. 106(See 107the FSA.) --- 42 unchanged lines hidden (view full) --- 150 if (strlen(arbitrary_string) + 1 > 151 sizeof(onstack) - strlen(onstack)) 152 err(1, "onstack would be truncated"); 153 (void)strncat(onstack, arbitrary_string, 154 sizeof(onstack) - strlen(onstack) - 1); 155#endif 156} 157.Ed |