diff --git a/src/tools/pkcs15-tool.c b/src/tools/pkcs15-tool.c index 33161357..019ab8c0 100644 --- a/src/tools/pkcs15-tool.c +++ b/src/tools/pkcs15-tool.c @@ -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;