Re: fopen_s
- From: "Eugene Gershnik" <gershnik@xxxxxxxxxxx>
- Date: Wed, 28 Jun 2006 09:32:14 -0700
David Webber wrote:
"Eugene Gershnik" <gershnik@xxxxxxxxxxx> wrote in message
news:O$6HiHnmGHA.464@xxxxxxxxxxxxxxxxxxxxxxx
How returning errno helps with error reporting and what this has to
do with security as such is beyond my imagination. Presumably
somebody at Microsoft has trouble understanding and using an API
that doesn't uniformly return error codes in COM manner.
I think we're in danger of taking this too literally in too isolated
a case. The new ...._s APIs which fill buffers (like strcpy_s) do
improve security - IIRC the debug version asserts if you try and
overfill the buffer.
You mix different things here. Debug version of CRT tries to assert whenever
you try to overflow any buffer regardless of what function you use. This
feature has been there since VC 7.0 long before the _s crap. The _s
functions usually force you to explicitly specify length of any buffer thus
making it hard to overflow in the first place. I don't know whether _s crap
is useful. Personally I cannot use it even if I wanted since anything I
write has above 0 probability of being ported.
Maybe fopen_s is not really needed for
security
Well that's exactly what MSDN says. It is supposed to improve error
reporting. However, improving reporting is described as security
enhancement... Probably some marketroid drunk more than usual while writing
this. ;-)
but is just there to complete the set?
And that's more or less what I say in the part you quoted ;-)
(Personally I find
the new ones - and all the warnings you get if you don't use them - a
pain.)
Yes though warnings are easily disabled. Personally as a customer I am
pissed off that MS have chosen to spend time on doing this _s crap instead
of something useful to me. I wonder if there are actual customers who had
this on the list of their desired features.
--
Eugene
http://www.gershnik.com
.
- Follow-Ups:
- Re: fopen_s
- From: Carl Daniel [VC++ MVP]
- Re: fopen_s
- References:
- fopen_s
- From: mike7411
- Re: fopen_s
- From: Eugene Gershnik
- Re: fopen_s
- From: David Webber
- fopen_s
- Prev by Date: Re: fopen_s
- Next by Date: Re: Is nmake.exe legally redistributable ?
- Previous by thread: Re: fopen_s
- Next by thread: Re: fopen_s
- Index(es):
Relevant Pages
|