title: read() - Check buffer boundaries if used in a loop including recursive loops
body: <p>I have this code and run it with Flawinder, and i get this output on the read() functions:</p>
  <blockquote>
  <p>Check buffer boundaries if used in a loop including recursive loops</p>
  </blockquote>
  <p>Can anyone see the problem?</p>
  <pre><code>#include &lt;stdlib.h&gt;
  void func(int fd)
  {
  
  char *buf;
  size_t len;
  read(fd, &amp;len, sizeof(len));
  
  if (len &gt; 1024)
  return;
  buf = malloc(len+1); 
  read(fd, buf, len); 
  buf[len] = '\0';
  }
  </code></pre>