strcpy, strcat, ... deprecated?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • DR

    #1

    strcpy, strcat, ... deprecated?

    why are those functions marked as deprecated in Vc++2005? what should be
    used instead?


  • William DePalo [MVP VC++]

    #2
    Re: strcpy, strcat, ... deprecated?

    "DR" <dr1234@yahoo.c om> wrote in message
    news:eBv3zMPsFH A.3264@TK2MSFTN GP12.phx.gbl...[color=blue]
    > why are those functions marked as deprecated in Vc++2005?[/color]

    Because malicious applications try to exploit vulnerabilities that arise
    when those functions overflow the buffers allocated to hold the strings.
    [color=blue]
    > what should be used instead?[/color]

    There are safer variants of the old C runtime functions described here:

    http://msdn.microsoft.com/library/de...efunctions.asp

    Regards,
    Will


    Comment

    • Willy Denoyette [MVP]

      #3
      Re: strcpy, strcat, ... deprecated?


      "DR" <dr1234@yahoo.c om> wrote in message
      news:eBv3zMPsFH A.3264@TK2MSFTN GP12.phx.gbl...[color=blue]
      > why are those functions marked as deprecated in Vc++2005? what should be
      > used instead?
      >[/color]

      Read all about the security enhanced versions of CRT functions:

      http://msdn2.microsoft.com/library/w...us,vs.80).aspx

      the motivations and how to deal with it:

      http://msdn.microsoft.com/msdnmag/is...C/default.aspx

      Willy.


      Comment

      • Egbert Nierop \(MVP for IIS\)

        #4
        Re: strcpy, strcat, ... deprecated?


        "DR" <dr1234@yahoo.c om> wrote in message
        news:eBv3zMPsFH A.3264@TK2MSFTN GP12.phx.gbl...[color=blue]
        > why are those functions marked as deprecated in Vc++2005? what should be
        > used instead?[/color]

        Funny, BSTR contains most of the support to avoid buffer overflows. Instead,
        the C++ / C default is a zero terminated string which is infamous of being
        interceptive for those overflows!...

        Comment

        Working...