Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Journal of nicholas (3034)

Friday May 15, 2009
09:39 AM

Microsoft security

[ #38982 ]

Maybe Microsoft thought they were doing OK on bolting on security as an afterthought, and pretending that it was built into their products from day zero. But they've just jumped the shark.

I am “proud” to announce that we intend to add memcpy() will to the SDL C and C++ banned API list later this year as we make further revisions to the SDL.

W.T.F.? Yes, sure, list several security updates that have memcpy in common. But I'm sure that's not the only thing they have in common. C would be a good start. Unlike most of the other functions that I'm aware of that have been added to the Microsoft Naughty Step, memcpy already had a length parameter. If one length parameter is insufficient to prevent muppets from screwing up, what makes you think that adding more of the same is going to have any real effect. Only Zaphod Beeblebrox would seriously argue that two heads are better than one. If someone is incapable of programming C safely with memcpy, they are still going to be incapable of programming C safely with memcpy_s. How long before we've reached memcpy_s_s_s ?

Oh, I thought, so where is memmove_s? They're not announcing that one. it seems that it already exists. And what do we have...

errno_t memmove_s(
   void *dest,
   size_t numberOfElements,
   const void *src,
   size_t count

Destination object.
Size of the destination buffer.
Source object.
Number of bytes of characters to copy.

OK, so I call it like this, right?

void total_balls_up(int *source) {
    int dest[4];

    if(!memmove_s(dest, 4, source, 2))
        return 0;


After all, you did describe it as number of elements, and I passed you in number of elements. How long before we have a CVE due to this one?

I guess we now know why Microsoft pulled the plug on the campus bar. It's because the microserfs are already continuously out of their brains on Pan Galactic Gargle Blasters.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • I don't know how they can talk about security when the MSDN advertise an example for memmove_s that tries to write into a string literal, which is undefined behaviour in regard to the C standard.
  • Needs more Hitchhiker references.
  • Screw that, I'm going straight to five blades! Just when I thought people couldn't do anything more clueless in the name of "security," I see this. Next move:

    void *
    SafeMemCpy(void *dst, int dst_len, void *src, int src_len, char *memcpy_password, int memcpy_password_len, int int_size, int ptr_size, __boolean__ yes_please_really_do_it)