title: I can't solve this Flawfinder Warning (CWE-78, CWE-120)
body: <p>I can't solve these two warnings found by Flawfinder. Could you answer to me with an example of the correct code?</p>
  
  <p><strong>Final results:</strong></p>
  
  <pre><code>flawfinder_exercise_old_SAL_syntax.cpp:48:  [4] (shell) system:
    This causes a new program to execute and is difficult to use safely
    (CWE-78). try using a library call that implements the same functionality
    if available.&lt;br&gt;
  flawfinder_exercise_old_SAL_syntax.cpp:36:  [2] (buffer) memcpy:
    Does not check for buffer overflows when copying to destination (CWE-120).
    Make sure destination can always hold the source data.*
  </code></pre>
  
  <p>This is the one in line 48:</p>
  
  <pre><code>int execute(char *buf) {
      return system(buf); // pass buf as command to be executed by the OS
  }
  </code></pre>
  
  <hr>
  
  <p>This is the one in line 36:</p>
  
  <pre><code>void copy_data(char *buf1,
                 char *buf2) {
      memcpy(buf2,buf1,STR_SIZE); 
      buf2[STR_SIZE-1] = NULL; // null terminate, just in case
  }
  </code></pre>