Ban memcpy??

Discussion in 'NZ Computing' started by Lawrence D'Oliveiro, May 19, 2009.

  1. You got to be kidding. strcpy and strcat, yes. memcpy, no. After all, you've
    got to use it somewhere, even if it's in the depths of a "managed code"
    library...

    <http://www.theregister.co.uk/2009/05/15/microsoft_banishes_memcpy/>
     
    Lawrence D'Oliveiro, May 19, 2009
    #1
    1. Advertising

  2. Lawrence D'Oliveiro

    Nik Coughlin Guest

    "Lawrence D'Oliveiro" <_zealand> wrote in message
    news:gutnqe$ala$...
    > You got to be kidding. strcpy and strcat, yes. memcpy, no. After all,
    > you've
    > got to use it somewhere, even if it's in the depths of a "managed code"
    > library...
    >
    > <http://www.theregister.co.uk/2009/05/15/microsoft_banishes_memcpy/>


    ....in favour of memcpy_s which explicity requires you to specify the size of
    the destination buffer.
     
    Nik Coughlin, May 19, 2009
    #2
    1. Advertising

  3. In message <guv4on$2ti$-september.org>, Nik Coughlin wrote:

    > "Lawrence D'Oliveiro" <_zealand> wrote in message
    > news:gutnqe$ala$...
    >
    >> You got to be kidding. strcpy and strcat, yes. memcpy, no. After all,
    >> you've got to use it somewhere, even if it's in the depths of a "managed
    >> code" library...
    >>
    >> <http://www.theregister.co.uk/2009/05/15/microsoft_banishes_memcpy/>

    >
    > ...in favour of memcpy_s which explicity requires you to specify the size
    > of the destination buffer.


    Doesn't seem to be specified in POSIX. Presumably this is a Microsoft thing?
    Not sure how it solves the problem.
     
    Lawrence D'Oliveiro, May 20, 2009
    #3
  4. Lawrence D'Oliveiro

    JohnO Guest

    On May 20, 11:38 am, Lawrence D'Oliveiro <l...@geek-
    central.gen.new_zealand> wrote:
    > In message <guv4on$-september.org>, Nik Coughlin wrote:
    >
    > > "Lawrence D'Oliveiro" <_zealand> wrote in message
    > >news:gutnqe$ala$...

    >
    > >> You got to be kidding. strcpy and strcat, yes. memcpy, no. After all,
    > >> you've got to use it somewhere, even if it's in the depths of a "managed
    > >> code" library...

    >
    > >> <http://www.theregister.co.uk/2009/05/15/microsoft_banishes_memcpy/>

    >
    > > ...in favour of memcpy_s which explicity requires you to specify the size
    > > of the destination buffer.

    >
    > Doesn't seem to be specified in POSIX. Presumably this is a Microsoft thing?
    > Not sure how it solves the problem.


    No point banning memcpy unless you ban pointers as well.
     
    JohnO, May 20, 2009
    #4
  5. In message <gutnqe$ala$>, Lawrence D'Oliveiro wrote:

    > You got to be kidding. strcpy and strcat, yes. memcpy, no. After all,
    > you've got to use it somewhere, even if it's in the depths of a "managed
    > code" library...
    >
    > <http://www.theregister.co.uk/2009/05/15/microsoft_banishes_memcpy/>


    Would seem to be so much simpler to ban null-terminated strings
    <http://www.schneier.com/blog/archives/2009/05/microsoft_bans.html>.
     
    Lawrence D'Oliveiro, May 21, 2009
    #5
  6. Lawrence D'Oliveiro

    Guest

    On May 21, 9:54 am, JohnO <> wrote:
    > On May 20, 11:38 am, Lawrence D'Oliveiro <l...@geek-
    >
    >
    >
    > central.gen.new_zealand> wrote:
    > > In message <guv4on$-september.org>, Nik Coughlin wrote:

    >
    > > > "Lawrence D'Oliveiro" <_zealand> wrote in message
    > > >news:gutnqe$ala$...

    >
    > > >> You got to be kidding. strcpy and strcat, yes. memcpy, no. After all,
    > > >> you've got to use it somewhere, even if it's in the depths of a "managed
    > > >> code" library...

    >
    > > >> <http://www.theregister.co.uk/2009/05/15/microsoft_banishes_memcpy/>

    >
    > > > ...in favour of memcpy_s which explicity requires you to specify the size
    > > > of the destination buffer.

    >
    > > Doesn't seem to be specified in POSIX. Presumably this is a Microsoft thing?
    > > Not sure how it solves the problem.

    >
    > No point banning memcpy unless you ban pointers as well.


    The best solution would be in the hardware. All data transfers to be
    using base-limit registers. The buffer overrun (addressing an array
    out of bounds, etc) is such a common error. Processors are fast
    enough nowadays so we wouldn't notice the performance hit. Or am I
    out of date, and processors have such instructions now?
     
    , May 21, 2009
    #6
  7. Lawrence D'Oliveiro

    JohnO Guest

    On May 21, 1:01 pm, wrote:
    > On May 21, 9:54 am, JohnO <> wrote:
    >
    >
    >
    > > On May 20, 11:38 am, Lawrence D'Oliveiro <l...@geek-

    >
    > > central.gen.new_zealand> wrote:
    > > > In message <guv4on$-september.org>, Nik Coughlin wrote:

    >
    > > > > "Lawrence D'Oliveiro" <_zealand> wrote in message
    > > > >news:gutnqe$ala$...

    >
    > > > >> You got to be kidding. strcpy and strcat, yes. memcpy, no. After all,
    > > > >> you've got to use it somewhere, even if it's in the depths of a "managed
    > > > >> code" library...

    >
    > > > >> <http://www.theregister.co.uk/2009/05/15/microsoft_banishes_memcpy/>

    >
    > > > > ...in favour of memcpy_s which explicity requires you to specify the size
    > > > > of the destination buffer.

    >
    > > > Doesn't seem to be specified in POSIX. Presumably this is a Microsoft thing?
    > > > Not sure how it solves the problem.

    >
    > > No point banning memcpy unless you ban pointers as well.

    >
    > The best solution would be in the hardware.  All data transfers to be
    > using base-limit registers.  The buffer overrun (addressing an array
    > out of bounds, etc) is such a common error.  Processors are fast
    > enough nowadays so we wouldn't notice the performance hit.  Or am I
    > out of date, and processors have such instructions now?


    But the authors of the language don't know what processors it will run
    on?
     
    JohnO, May 21, 2009
    #7
  8. Lawrence D'Oliveiro

    JohnO Guest

    On May 21, 12:54 pm, Lawrence D'Oliveiro <l...@geek-
    central.gen.new_zealand> wrote:
    > In message <gutnqe$>, Lawrence D'Oliveiro wrote:
    >
    > > You got to be kidding. strcpy and strcat, yes. memcpy, no. After all,
    > > you've got to use it somewhere, even if it's in the depths of a "managed
    > > code" library...

    >
    > > <http://www.theregister.co.uk/2009/05/15/microsoft_banishes_memcpy/>

    >
    > Would seem to be so much simpler to ban null-terminated strings
    > <http://www.schneier.com/blog/archives/2009/05/microsoft_bans.html>.


    Ban this, ban that... are you a Green Party policy analyst perchance?
     
    JohnO, May 21, 2009
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt

    Annoying ban at bottom of outlook

    Matt, Jul 11, 2003, in forum: Computer Support
    Replies:
    1
    Views:
    546
    °Mike°
    Jul 11, 2003
  2. Jim Nicholson

    Assault Weapon Ban Deserves Renewal

    Jim Nicholson, Feb 16, 2004, in forum: Computer Support
    Replies:
    15
    Views:
    729
    Misa Mirkovic
    Feb 21, 2004
  3. Misa Mirkovic

    Re: Assault Weapon Ban Deserves Renewal

    Misa Mirkovic, Feb 22, 2004, in forum: Computer Support
    Replies:
    0
    Views:
    404
    Misa Mirkovic
    Feb 22, 2004
  4. Hamman

    Ban a Non Static IP Address?

    Hamman, May 15, 2004, in forum: Computer Support
    Replies:
    9
    Views:
    1,234
    billybronco
    May 16, 2004
  5. =?Utf-8?B?a2xhdXM=?=

    strange performance behaviour for memcpy

    =?Utf-8?B?a2xhdXM=?=, May 3, 2006, in forum: Windows 64bit
    Replies:
    9
    Views:
    1,506
    Guest
    May 5, 2006
Loading...

Share This Page