{"type":"rich","provider_url":"https://hatena.blog","published":"2005-12-27 00:00:01","height":"190","url":"https://yupo5656.hatenadiary.org/entry/20051227/p2","blog_title":"memologue","blog_url":"https://yupo5656.hatenadiary.org/","title":" operator new\u306e\u96a0\u308c\u305f\u6574\u6570\u30aa\u30fc\u30d0\u30fc\u30d5\u30ed\u30fc\u3068VisualStudio 2005\u306eVC++","width":"100%","author_url":"https://blog.hatena.ne.jp/yupo5656/","provider_name":"Hatena Blog","description":"void vuln(std::size_t nelem) { int* p = new int[nelem]; std::memset(p, 12345, nelem); }\u4e0a\u8a18\u306e\u95a2\u6570\u306b\u306f\u6574\u6570\u30aa\u30fc\u30d0\u30fc\u30d5\u30ed\u30fc\u306b\u8d77\u56e0\u3059\u308b\u30d2\u30fc\u30d7\u30d9\u30fc\u30b9\u30d0\u30c3\u30d5\u30a1\u30aa\u30fc\u30d0\u30fc\u30d5\u30ed\u30fc\u306e\u8106\u5f31\u6027\u304c\u3042\u308b\u3093\u3067\u3059\u304c\u3001\u3069\u3053\u304c\u307e\u305a\u3044\u304b\u308f\u304b\u308a\u307e\u3059\u304b\uff1f \u307e\u305a\u3044\u306e\u306fnew\u3057\u3066\u3044\u308b\u90e8\u5206\u3067\u3059\u3002C++\u30b3\u30f3\u30d1\u30a4\u30e9\u306f\u5185\u90e8\u3067\u3001nelem * sizeof(int) \u3001\u3064\u307e\u308anelem * 0x4U \u3092\u8a08\u7b97\u3057\u3066\u304b\u3089\u3001\u305d\u306e\u7d50\u679c\u3092\u5f15\u6570\u306b\u3057\u3066operator new\u3092call\u3059\u308b\u3093\u3067\u3059\u304c*1\u3001\u3082\u3057nelem\u306e\u5024\u304c 0x40000001U \u3060\u3063\u305f\u308a\u3057\u305f\u3089\u3069\u3046\u306a\u308b\u3067\u3057\u3087\u2026","image_url":"https://images-fe.ssl-images-amazon.com/images/I/61J5PGR9KGL._SL75_.jpg","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fyupo5656.hatenadiary.org%2Fentry%2F20051227%2Fp2\" title=\" operator new\u306e\u96a0\u308c\u305f\u6574\u6570\u30aa\u30fc\u30d0\u30fc\u30d5\u30ed\u30fc\u3068VisualStudio 2005\u306eVC++ - memologue\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","author_name":"yupo5656","categories":["C++"],"version":"1.0"}