From: Ezra Peisach Date: Tue, 31 Jul 2001 08:53:02 +0000 (+0000) Subject: * read_passwd.c: Create local variable that takes the "int" X-Git-Tag: krb5-1.3-alpha1~1151 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=01a4a3847b359a6c243ed33225f21aa382fde584;p=krb5.git * read_passwd.c: Create local variable that takes the "int" bufsize and makes it unsigned for use in malloc, strcmp, etc. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13660 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/des425/ChangeLog b/src/lib/des425/ChangeLog index 6089b46ef..278b95f2e 100644 --- a/src/lib/des425/ChangeLog +++ b/src/lib/des425/ChangeLog @@ -1,3 +1,8 @@ +2001-07-31 Ezra Peisach + + * read_passwd.c: Create local variable that takes the "int" + bufsize and makes it unsigned for use in malloc, strcmp, etc. + 2001-07-19 Ken Raeburn * des.c (des_ecb_encrypt): Put "static" before "const" for local diff --git a/src/lib/des425/read_passwd.c b/src/lib/des425/read_passwd.c index 31bbd9763..586209366 100644 --- a/src/lib/des425/read_passwd.c +++ b/src/lib/des425/read_passwd.c @@ -58,9 +58,9 @@ intr_routine(signo) /*** Routines ****************************************************** */ krb5_error_code -des_read_pw_string/*_v4_compat_crock*/(return_pwd, bufsize, prompt, prompt2) +des_read_pw_string/*_v4_compat_crock*/(return_pwd, bufsize_in, prompt, prompt2) char *return_pwd; - int bufsize; + int bufsize_in; char *prompt; char *prompt2; { @@ -69,6 +69,7 @@ des_read_pw_string/*_v4_compat_crock*/(return_pwd, bufsize, prompt, prompt2) int scratchchar; krb5_sigtype (*volatile ointrfunc)(); krb5_error_code errcode; + size_t bufsize = bufsize_in; #ifndef ECHO_PASSWORD struct termios echo_control, save_control; int fd; @@ -98,7 +99,7 @@ des_read_pw_string/*_v4_compat_crock*/(return_pwd, bufsize, prompt, prompt2) (void) fflush(stdout); (void) memset(return_pwd, 0, bufsize); - if (fgets(return_pwd, bufsize, stdin) == NULL) { + if (fgets(return_pwd, bufsize_in, stdin) == NULL) { (void) putchar('\n'); errcode = KRB5_LIBOS_CANTREADPWD; goto cleanup; @@ -124,7 +125,7 @@ des_read_pw_string/*_v4_compat_crock*/(return_pwd, bufsize, prompt, prompt2) goto cleanup; } (void) memset((char *)readin_string, 0, bufsize); - if (fgets((char *)readin_string, bufsize, stdin) == NULL) { + if (fgets((char *)readin_string, bufsize_in, stdin) == NULL) { (void) putchar('\n'); errcode = KRB5_LIBOS_CANTREADPWD; goto cleanup;