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:
parent
e9314adf4b
commit
1eaae6526b
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue