原文地址:http://www.theregister.co.uk/2009/05/15/microsoft_banishes_memcpy/

Memcpy() and brethren, your days are numbered. At least in development shops that aspire to secure coding.

Microsoft plans to formally banish the popular programming function that's been responsible for an untold number of security vulnerabilities over the years, not just in Windows but in countless other applications based on the C language. Effective later this year, Microsoft will add memcpy(), CopyMemory(), and RtlCopyMemory() to its list of function calls banned under its secure development lifecycle.

Memcpy has long served as a basic staple of C-based languages, providing a simple way to copy the contents from one chunk of memory to another. Its drawback comes when the source to be copied contains more bytes than its destination, creating overflows that present attackers with opportunities to remotely execute code in the underlying application.

"That's definitely one of those notoriously dangerous C commands," said Johannes Ullrich, CTO of the SANS Institute, who teaches secure coding classes to developers. He likened memcpy() to other risky functions such as strcpy() and strcat(), which Microsoft has already banned after exacting untold misery over the years.

Developers who want to be SDL compliant will instead have to replace memcpy() functions with memcpy_s, a newer command that takes an additional parameter delineating the size of the destination buffer. The command is already supported in Microsoft's Visual C++, but according to Ullrich, native support doesn't yet seem to be available in the GCC compiler. (This evidently can easily be worked around, according to this discussion. Readers who know other approaches are encouraged to leave a comment.)

A Microsoft blog entry that heralded the planned change suggests modifying common header files so compilers issue a warning each time the banned function is used.

It also wondered aloud when "Larry, Steve, and Linus" plan to issue similar security edicts in their products. It's a question worth asking. ®

转载于:https://www.cnblogs.com/cxun/archive/2009/05/18/1459172.html

[转]Unsafe at any speed: Memcpy() banished in Redmond相关推荐

  1. 四轮驱动(SSMR)移动机器人手柄控制

    四轮驱动(SSMR)移动机器人手柄控制 理论推导 理论推导可以参考下面的文章 四轮驱动(SSMR)移动机器人运动模型及应用分析 (qq.com) 有几个点需要注意一下: 推导假设车的形心与车的质心重合 ...

  2. 自动驾驶发展_自动驾驶网络及其发展

    自动驾驶发展 介绍 (Introduction) Talking about inspiration in the networking industry, nothing more than Aut ...

  3. Interactive Critical System And How to Build Them

    Interactive Critical System And How to Build Them 论文翻译:罗淇允.吕栢霖.江锋 介绍 我们都知道许多令人沮丧的交互例子,它们通常因为没有过多的设计而 ...

  4. Cgo,Go与C交互的详细介绍

    Cgo,详细介绍Go与C交互详细过程 文章目录 Cgo,详细介绍Go与C交互详细过程 概念解释 使用Cgo在Go中直接编写C代码 Cgo工作的基本过程 基础类型转换 关于字符串的两个特别的方法 结构体 ...

  5. 技术洞见|软件定义汽车的思辩

    本文由<汽车软件架构>译者根据译者序改写,原文撰写于2020年3月,两年过去,作者对其中一些观点补充了行业最新的实践.本文对"软件定义汽车"这一概念进行了全面概述,内容 ...

  6. go dll char* memcpy

    dll := syscall.MustLoadDLL("hik_client.dll")callback := syscall.NewCallback(func(r uintptr ...

  7. C# unsafe模式内存操作深入探索

    C# unsafe模式内存操作深入探索 using System; using System.Collections.Generic; using System.IO; using System.Li ...

  8. Memcpy, blockcopy的进一步理解

    Memcpy, blockcopy的进一步理解 using System; using System.Runtime.InteropServices; using System.IO; namespa ...

  9. C#调用C++ memcpy实现各种参数类型的内存拷贝 VS marshal.copy的实现 效率对比

    C#调用C++ memcpy实现各种参数类型的内存拷贝 VS marshal.copy的实现 效率对比 using System; using System.Runtime.InteropServic ...

最新文章

  1. IE6 下div高度显示的问题
  2. 【c语言】判断是否为友好数
  3. datagridview滚动条自动滚动_Win32编程基础之滚动条
  4. UVA227 Puzzle
  5. linux下递归修改目录/文件权限命令
  6. Erlang中使用变量的简单示例
  7. 现代软件工程 第二章 【个人技术】 练习与讨论
  8. java 标识符_java标识符是什么
  9. 共享单车变“私有”、被毁、被盗:用户们都看不下去了,举报!
  10. 2022年3月23日蜻蜓q旗舰版v1.2.1重大性能更新-优化加载列表数据方式-更加丝滑-后端增加goeasy
  11. 计算机桌面截屏快捷键,关于电脑屏幕截图的快捷键是什么
  12. cad 2019 mac安装破解详细图文教程
  13. 文献盘点|回眸2021,理一理科研圈探索的那些大发现
  14. 启动prometheus问题-opening storage failed
  15. python实现pdf格式转换图片格式
  16. uniapp实现自定义相机
  17. 抖音短视频运营中的六大定位法
  18. 失落的帝国-亚特兰蒂斯
  19. 0.总也记不住的考场or竞赛必备stl各种用法及其他技巧
  20. 微信小程序常见问题汇总

热门文章

  1. 伺服电机三环(电流环、速度环、位置环)控制原理及参数调节
  2. 知识管理在企业业务中如何体现其价值
  3. 如果遇到提示错误 reactivity.esm-bundler.js?a1e9:337 Set operation on key “default“ failed: target is readonl
  4. vgh电压高了有什么_220伏都能电死人,10000伏高压的电子围栏为什么是安全的?...
  5. 根轨迹法不完全笔记(自动控制原理)
  6. (渗透测试后期)Linux进程隐藏详解
  7. Oracle数据库基本常用命令
  8. 谷歌浏览器如何彻底关闭右下角弹出的广告弹窗
  9. 怎样与项目中的“怪人”沟通
  10. python抓取网站重要url_[Python]网络爬虫(一):抓取网页的含义和URL基本构成