summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/ui')
-rw-r--r--src/lib/libcrypto/ui/ui_openssl.c2
-rw-r--r--src/lib/libcrypto/ui/ui_util.c7
2 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/libcrypto/ui/ui_openssl.c b/src/lib/libcrypto/ui/ui_openssl.c
index 4e12165410..2c2fbc0443 100644
--- a/src/lib/libcrypto/ui/ui_openssl.c
+++ b/src/lib/libcrypto/ui/ui_openssl.c
@@ -269,7 +269,7 @@ static long tty_orig[3], tty_new[3]; /* XXX Is there any guarantee that this w
269static long status; 269static long status;
270static unsigned short channel = 0; 270static unsigned short channel = 0;
271#else 271#else
272#ifndef OPENSSL_SYS_MSDOS 272#if !defined(OPENSSL_SYS_MSDOS) || defined(__DJGPP__)
273static TTY_STRUCT tty_orig,tty_new; 273static TTY_STRUCT tty_orig,tty_new;
274#endif 274#endif
275#endif 275#endif
diff --git a/src/lib/libcrypto/ui/ui_util.c b/src/lib/libcrypto/ui/ui_util.c
index 7c6f7d3a73..f05573df33 100644
--- a/src/lib/libcrypto/ui/ui_util.c
+++ b/src/lib/libcrypto/ui/ui_util.c
@@ -71,12 +71,15 @@ int UI_UTIL_read_pw(char *buf,char *buff,int size,const char *prompt,int verify)
71 int ok = 0; 71 int ok = 0;
72 UI *ui; 72 UI *ui;
73 73
74 if (size < 1)
75 return -1;
76
74 ui = UI_new(); 77 ui = UI_new();
75 if (ui) 78 if (ui)
76 { 79 {
77 ok = UI_add_input_string(ui,prompt,0,buf,0,BUFSIZ-1); 80 ok = UI_add_input_string(ui,prompt,0,buf,0,size-1);
78 if (ok == 0 && verify) 81 if (ok == 0 && verify)
79 ok = UI_add_verify_string(ui,prompt,0,buff,0,BUFSIZ-1, 82 ok = UI_add_verify_string(ui,prompt,0,buff,0,size-1,
80 buf); 83 buf);
81 if (ok == 0) 84 if (ok == 0)
82 ok=UI_process(ui); 85 ok=UI_process(ui);