Increase internal security when using strncpy, by making sure the resulting string is NUL-terminated

This commit is contained in:
Richard Levitte
2002-02-28 12:42:19 +00:00
parent 5c62f68e14
commit 26414ee013
6 changed files with 18 additions and 4 deletions

View File

@@ -94,6 +94,7 @@ int i;
OPENSSL_free(b);
}
strncpy(buf,"NO X509_NAME",len);
buf[len-1]='\0';
return buf;
}