pkcs15-tool: Build with current gcc

The argument to strncpy is not the length of the target buffer,
but the source one (excluding the null byte, which will be
copied anyway).
This commit is contained in:
Jakub Jelen 2018-06-28 13:42:58 +02:00 committed by Frank Morgner
parent e9314adf4b
commit 1eaae6526b
1 changed files with 1 additions and 1 deletions

View File

@ -1022,7 +1022,7 @@ static int read_ssh_key(void)
buf[1] = 0;
buf[2] = 0;
len = snprintf((char *) buf+4, 20, "ecdsa-sha2-nistp%d", n);
strncpy(alg, (char *) buf+4, 20);
strncpy(alg, (char *) buf+4, 19);
buf[3] = len;
len += 4;