This is the mail archive of the
mailing list for the glibc project.
Re: strcpy_s, strlcpy, and strncpy and checking for overflow
- From: "Yuhong Bao" <yuhongbao_386 at hotmail dot com>
- To: libc-alpha at sourceware dot org
- Date: Sun, 06 May 2007 10:14:08 -0700
- Subject: Re: strcpy_s, strlcpy, and strncpy and checking for overflow
One of the arguments is that programmers should be concerned when a string
buffer oveflow, and so my point is that that strlcpy make it easier to check
overflow and strcpy_s refuse to copy the string at all if the buffer
Regardless it is not part of a standard yet, so it may not be a good idea to
add it to glibc.
From: Mike Frysinger <email@example.com>
CC: "Yuhong Bao" <firstname.lastname@example.org>
Subject: Re: strcpy_s, strlcpy, and strncpy and checking for overflow
Date: Sun, 6 May 2007 03:28:40 -0400
Received: from smtp.gentoo.org ([126.96.36.199]) by
bay0-mc8-f13.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2668); Sun, 6
May 2007 00:28:19 -0700
Received: from ip6-localhost (localhost [127.0.0.1])by smtp.gentoo.org
(Postfix) with ESMTP id F14676491D;Sun, 6 May 2007 07:28:18 +0000 (UTC)
X-OriginalArrivalTime: 06 May 2007 07:28:19.0817 (UTC)
On Saturday 05 May 2007, Yuhong Bao wrote:
> But one of the arguments is that programmers should be concerned about
> effect of truncation. strlcpy make it easier than strncpy to check for
> truncation too, and strcpy_s (part of VC2005 libraries) refuse to copy
> string at all if the string is going to be truncated. You must use
> strncpy_s with _TRUNCATE in the count parameter.
what exactly is your point ? do you want to change something in glibc ?
<< signature.asc >>
Add the Windows Live Messenger NHL Stats Agent to your buddy list and get
your stats fix instantly http://sports.sympatico.msn.ca/NHL/NHL_Stats_Agent