title: segmentation fault (core dump)
body: <p>I'm getting a segmentation error (core dump) when I try to run this. It compiles perfectly but I get the error, and I don't know why. I've tried to edit my code in all possible ways, but am still getting this error. I'm out of ideas already. Any help would be great. Thanks!</p>
  
  <pre><code>    unsigned short *reg = NULL;
  
      int byte;
      int i;
      for (byte = 0; byte &lt; num_bytes; byte++){
          unsigned int next_byte = (unsigned int) message[byte];
          crc_byte(reg, key, next_byte);
      }
  
      for (i = 0; i &lt; 16; i++){
          crc_bit(reg, key, 0);
      }
  
      return *reg;
  }
  </code></pre>