Re: fopen_s




"Carl Daniel [VC++ MVP]" <cpdaniel_remove_this_and_nospam@xxxxxxxxxxxxxxx>
wrote in message news:uKn6cltmGHA.3352@xxxxxxxxxxxxxxxxxxxxxxx
"Eugene Gershnik" <gershnik@xxxxxxxxxxx> wrote in message
news:uoK8rBtmGHA.2372@xxxxxxxxxxxxxxxxxxxxxxx
David Webber wrote:
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. ;-)

Actually, it follows directly from studies of security vulnerabilities.
Not checking error codes is a major source of security vulnerabilities.

Ok.

Having inconsistent ways of returning error codes is a major source of
error codes not being checked.

I don't think it is true. COM had "everything returns HRESULT" policy since
the beginning and how much COM code does actually check all of them?
The major source of error codes not being checked is that programmers are
not punished for doing it. There is nothing MS can do about it.

--
Eugene
http://www.gershnik.com



.



Relevant Pages

  • Re: fopen_s
    ... with security as such is beyond my imagination. ... Microsoft has trouble understanding and using an API that doesn't ... uniformly return error codes in COM manner. ...
    (microsoft.public.vc.language)
  • Re: fopen_s
    ... improving reporting is described as security ... checking error codes is a major source of security vulnerabilities. ...
    (microsoft.public.vc.language)
  • Event log Error codes
    ... Lately we've turned on security and in out event log we ... are getting unexplained evnets, error codes 577 and 560. ...
    (microsoft.public.win2000.security)