Newer GCCs do not like truncation and emit a warning. We don't want to
disable truncation warnings (-Wnostringop-truncation), as in some cases
these warnings can point to a security flaw.
Using strcat instead of strncat is fine, since *both* equally overflow
the destination buffer if not used carefully.
See https://developers.redhat.com/blog/2018/05/24/detecting-string-truncation-with-gcc-8/
*end = '\0';
}
GNUNET_CRYPTO_hash_to_enc (&sh, &ae);
- strncat (unixpath, (char *) ae.encoding, 16);
+ ae.encoding[16] = '\0';
+ strcat (unixpath, (char *) ae.encoding);
return unixpath;
}