title: Bad pointer when using malloc?
body: <p>I'm trying the following:</p>
  
  <pre><code>int length = strlen(input)+1;
  char * toCrypt = (char*)malloc(length);
  </code></pre>
  
  <p>Where input is some string. Whats strange is that sometimes this does work, and sometimes toCrypt gives a bad pointer... Solutions?</p>