{"title":" signed int\u3067\u306e\u914d\u5217\u30a2\u30af\u30bb\u30b9\u306f\u30de\u30b8\u30e4\u30d0\u30a4\uff08\u3053\u3068\u3082\u3042\u308b\uff09","type":"rich","width":"100%","image_url":null,"provider_name":"Hatena Blog","blog_url":"https://yupo5656.hatenadiary.org/","description":"\u6b21\u306eC/C++\u306a\u30b3\u30fc\u30c9\u306b\u306f\u554f\u984c\u304c\u3042\u308a\u307e\u3059\u3002 #define A_SIZE 6 static int a[A_SIZE]; void vuln(int n, int val) { assert(n < A_SIZE); a[n] = val; }\u914d\u5217\u30a2\u30af\u30bb\u30b9\u306e\u6dfb\u5b57\u3068\u306a\u308b\u5909\u6570a\u306e\u65b9\u304c signed int \u306a\u306e\u304c\u554f\u984c\u3067\u3059\u3002n\u3068\u3057\u3066\u8ca0\u6570\u3092\u6e21\u3059\u3068\u9762\u767d\u3044\uff08\u3068\u3044\u3046\u304b\u6050\u308d\u3057\u3044\uff1f\uff09\u52d5\u4f5c\u3092\u3057\u307e\u3059\u3002 \u3048\u3048\u3068\u30fb\u30fb(int)(0x80000000U + n) \u3092 vuln\u306e\u7b2c\u4e00\u5f15\u6570\u3068\u3057\u3066\u6e21\u3059\u3068*1\u3001vuln\u5185\u306e\u914d\u5217x\u306ex[n]\u306b\u66f8\u304d\u8fbc\u3080\u3053\u3068\u304c\u3067\u304d\u3066\u3057\u307e\u3046\u306e\u3067\u3059\u3002\u3082\u3061\u308d\u3093\u3001\u914d\u5217\u306e\u5883\u754c\u30c1\u30a7\u30c3\u30af\u306f\u884c\u308f\u308c\u307e\u305b\u3093\u3002\u3060\u304b\u3089\u3001 i\u2026","height":"190","author_url":"https://blog.hatena.ne.jp/yupo5656/","author_name":"yupo5656","url":"https://yupo5656.hatenadiary.org/entry/20051230/p1","blog_title":"memologue","categories":["C++"],"provider_url":"https://hatena.blog","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fyupo5656.hatenadiary.org%2Fentry%2F20051230%2Fp1\" title=\" signed int\u3067\u306e\u914d\u5217\u30a2\u30af\u30bb\u30b9\u306f\u30de\u30b8\u30e4\u30d0\u30a4\uff08\u3053\u3068\u3082\u3042\u308b\uff09 - memologue\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","version":"1.0","published":"2005-12-30 00:00:00"}