<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>e_c_e_t</author_name>
  <author_url>https://blog.hatena.ne.jp/e_c_e_t/</author_url>
  <blog_title>記録（e_c_e_t）</blog_title>
  <blog_url>https://e-c-e-t.hatenadiary.org/</blog_url>
  <categories>
  </categories>
  <description>前に、wsprintfやsprintfは、バッファオーバーフローを防げなくて参った、と、思ってたら、 snprintfという関数があった（というのを最近知った）。 たとえばこういうソースを書くと、とんでもない事になる。 #include &lt;stdio.h&gt; int main(int argc, char **argv) { char buf[10]; memset(&amp;buf, 0, sizeof(buf)); sprintf(buf, &quot;%15s&quot;, &quot;0123456789abcde&quot;); printf(&quot;実行結果&quot;); printf(buf); return 0; } 実行結果 012345…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fe-c-e-t.hatenadiary.org%2Fentry%2F20071121&quot; title=&quot;バッファオーバーフローを防げ - 記録（e_c_e_t）&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2007-11-21 00:00:00</published>
  <title>バッファオーバーフローを防げ</title>
  <type>rich</type>
  <url>https://e-c-e-t.hatenadiary.org/entry/20071121</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
