title: FORTIFY: vsprintf: prevented 33-byte write into 32-byte buffer
body: <p>Good morning, 
  I am using a native library on an Android Project, it is just a simple md5hash of the package signature, but
  I am facing an issue on 64 bit devices with the JNI function :</p>
  
  <pre><code>char *getSignatureMd5(JNIEnv *env, jobject obj) {
      char *sign = loadSignature(env, obj);
      MD5_CTX context = {0};
      MD5Init(&amp;context);
      MD5Update(&amp;context, (unsigned char *) sign, strlen(sign));
      unsigned char dest[16] = {0};
      MD5Final(dest, &amp;context);
      int i;
      static char destination[32] = {0};
      for (i = 0; i &lt; 16; i++) {
          sprintf(destination, "%s%02x", destination, dest[i]);
      }
      LOGD("MD5 Chacksum : %s", destination);
      return destination;
  }
  </code></pre>
  
  <p>I am using it since years so nothing has changed in the code itself, but I guess an NDK or Cmake update causes this :-(
  This is the Crash report i get:</p>
  
  <pre><code>2020-04-18 08:38:13.038 5621-5621/? A/DEBUG: Revision: '10'
  2020-04-18 08:38:13.038 5621-5621/? A/DEBUG: ABI: 'arm64'
  2020-04-18 08:38:13.038 5621-5621/? A/DEBUG: pid: 5187, tid: 5423, name: APP-AsyncTa  &gt;&gt;&gt; com.pecana.app &lt;&lt;&lt;
  2020-04-18 08:38:13.038 5621-5621/? A/DEBUG: signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
  2020-04-18 08:38:13.040 5621-5621/? A/DEBUG: Abort message: 'FORTIFY: vsprintf: prevented 33-byte write into 32-byte buffer'
  2020-04-18 08:38:13.040 5621-5621/? A/DEBUG:     x0  0000000000000000  x1  000000000000152f  x2  0000000000000006  x3  0000000000000008
  2020-04-18 08:38:13.040 5621-5621/? A/DEBUG:     x4  0000000000000000  x5  0000000000000000  x6  0000000000000000  x7  0000000000000038
  2020-04-18 08:38:13.040 5621-5621/? A/DEBUG:     x8  0000000000000083  x9  0000007007fb9878  x10 fffffff87ffffbdf  x11 0000000000000001
  2020-04-18 08:38:13.041 5621-5621/? A/DEBUG:     x12 0000000000000030  x13 000000005e9aa050  x14 001fb5a729ce1580  x15 000040d9dceb878c
  2020-04-18 08:38:13.042 5621-5621/? A/DEBUG:     x16 0000007007ff02a0  x17 0000007007f2f920  x18 0000000000000000  x19 0000000000001443
  2020-04-18 08:38:13.042 5621-5621/? A/DEBUG:     x20 000000000000152f  x21 0000000000000083  x22 000000000000000f  x23 0000006f6a48dcc2
  2020-04-18 08:38:13.043 5621-5621/? A/DEBUG:     x24 0000000000000004  x25 0000006f5c0f5588  x26 0000006f6b0a04a0  x27 0000000000000001
  2020-04-18 08:38:13.043 5621-5621/? A/DEBUG:     x28 0000006f5c0f30c0  x29 0000006f5c0f2c00
  2020-04-18 08:38:13.044 5621-5621/? A/DEBUG:     sp  0000006f5c0f2bc0  lr  0000007007f22d68  pc  0000007007f22d94
  </code></pre>
  
  <p>What can I do to fix this ?</p>
  
  <p>Thank you!</p>