malloc the new length, not the old, esp. since we just check that the
authorMark Eichin <eichin@mit.edu>
Mon, 18 Mar 1996 02:46:10 +0000 (02:46 +0000)
committerMark Eichin <eichin@mit.edu>
Mon, 18 Mar 1996 02:46:10 +0000 (02:46 +0000)
old length was zero

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7654 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/krb/in_tkt_pwd.c

index ce954a7d84bcf39a97c04406445439cfc3b23452..52ef240b92bd84942f3b411baecaad095723aa51 100644 (file)
@@ -60,7 +60,7 @@ pwd_keyproc(context, type, salt, keyseed, key)
 
     if (!password->length) {
        pwsize = BUFSIZ;
-       if ((password->data = malloc(password->length)) == NULL)
+       if ((password->data = malloc(pwsize)) == NULL)
            return ENOMEM;
        
        if ((retval = krb5_read_password(context, krb5_default_pwd_prompt1, 0,