(krb4_vprintf): replaced vsprintf with vsnprintf

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1697 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1997-05-11 09:00:07 +00:00
parent f4812b0463
commit 24bd88f181

View File

@@ -341,15 +341,16 @@ int krb4_userok(char *name)
} }
int krb4_vprintf(const char *fmt, va_list ap) int
krb4_vprintf(const char *fmt, va_list ap)
{ {
char buf[10240]; /* XXX */ char buf[10240];
char *p; char *p;
char *enc; char *enc;
int code; int code;
int len; int len;
vsprintf(buf, fmt, ap); vsnprintf (buf, sizeof(buf), fmt, ap);
enc = malloc(strlen(buf) + 31); enc = malloc(strlen(buf) + 31);
if(prot_level == prot_safe){ if(prot_level == prot_safe){
len = krb_mk_safe((u_char*)buf, (u_char*)enc, strlen(buf), &auth_dat.session, len = krb_mk_safe((u_char*)buf, (u_char*)enc, strlen(buf), &auth_dat.session,