2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00

4748. [cleanup] Sprintf to snprintf coversions. [RT #46132]

This commit is contained in:
Mark Andrews
2017-10-03 14:54:19 +11:00
parent 7cb14b610e
commit a009d03a1a
55 changed files with 179 additions and 146 deletions

View File

@@ -695,10 +695,14 @@ dst_gssapi_acceptctx(gss_cred_id_t cred,
*/
const char *old = getenv("KRB5_KTNAME");
if (old == NULL || strcmp(old, gssapi_keytab) != 0) {
char *kt = malloc(strlen(gssapi_keytab) + 13);
size_t size;
char *kt;
size = strlen(gssapi_keytab) + 13;
kt = malloc(size);
if (kt == NULL)
return (ISC_R_NOMEMORY);
sprintf(kt, "KRB5_KTNAME=%s", gssapi_keytab);
snprintf(kt, size, "KRB5_KTNAME=%s", gssapi_keytab);
if (putenv(kt) != 0)
return (ISC_R_NOMEMORY);
}