[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [TSVN] Running 64 bit prototype of TSVN 1.2.1 built with VS2005

From: Joseph Galbraith <galb_at_vandyke.com>
Date: 2005-08-20 03:54:53 CEST

Erik Anderson wrote:
> _strcpy_s ?!? Whatever happened to strncpy?

strncpy()'s length parameter says don't read more
than n bytes from the input. I do agree that
using strncpy() over strcpy() would solve most
of the problems strcpy_s is trying to solve.

MS does provide strncpy_s as well, which takes
four parameters.

It isn't standard, but in todays world of buffer
overflow attacks, it probably isn't a totally
stupid thing either.

Of course, anyone writing portable code is just
going to turn off the warnings and keep using
the standard versions of the functions.

Thanks,

Joseph

> -----Original Message-----
> From: Joseph Galbraith [mailto:galb@vandyke.com]
> Sent: Friday, August 19, 2005 5:40 PM
> To: dev@tortoisesvn.tigris.org
> Subject: Re: [TSVN] Running 64 bit prototype of TSVN 1.2.1 built with
> VS2005
>
> Mark Phippard wrote:
>> Stefan Fuhrmann <stefanfuhrmann@alice-dsl.de> wrote on 08/19/2005
> 01:48:01
>> PM:
>>>> Or, once I have VS2005 myself we could just get rid of the 'unsafe'
>>>> functions ;)
>>> That would be nice. Since TSVN is bound to Win32 anyway, there is
>>> no compelling reason to stick with the std C functions.
>> Didn't Will Dean (or perhaps Stefan) make a bunch of changes from using
>> Win32 file API's to using std C functions because the latter were orders
>
>> of magnitude faster? Perhaps not the same functions being talked about
>> here?
>
> I don't think so.
>
> The functions referred to here are MS replacements for C runtime
> functions that write to a buffer without taking a size
> argument for the output buffer, such as strcpy(), sprintf(), etc.
>
> MS provides replacement functions _strcpy_s which take
> an additional parameter, the length of the output buffer.
>
> I believe there are other functions which they've replaced
> for various reasons attempting to make programs less like
> to have buffer overflows-- I'm not familiar with the
> reasoning behind all of them.
>
> Thanks,
>
> Joseph
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
> For additional commands, e-mail: dev-help@tortoisesvn.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org
Received on Sat Aug 20 03:47:33 2005

This is an archived mail posted to the TortoiseSVN Dev mailing list.