Avoid sprintf.

This commit is contained in:
Bodo Möller 2000-05-21 14:17:01 +00:00
parent 2ea0910031
commit 063c0502ef

View File

@ -975,13 +975,14 @@ char *SSL_CIPHER_description(SSL_CIPHER *cipher, char *buf, int len)
if (buf == NULL) if (buf == NULL)
{ {
buf=Malloc(128); len=128;
buf=Malloc(len);
if (buf == NULL) return("Malloc Error"); if (buf == NULL) return("Malloc Error");
} }
else if (len < 128) else if (len < 128)
return("Buffer too small"); return("Buffer too small");
sprintf(buf,format,cipher->name,ver,kx,au,enc,mac,exp); BIO_snprintf(buf,len,format,cipher->name,ver,kx,au,enc,mac,exp);
return(buf); return(buf);
} }