X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fui%2Fui_util.c;h=f05573df3384e9ea7dc7276713ef96a848244f45;hp=7c6f7d3a73f615fb8dbb87fdc2d2b0799f796be6;hb=94960c84215f89cc7f655ad13418fbb38e597ed2;hpb=44bdb056d4c7c72494d5d4b702bbad5cc869df03;ds=sidebyside diff --git a/crypto/ui/ui_util.c b/crypto/ui/ui_util.c index 7c6f7d3a73..f05573df33 100644 --- a/crypto/ui/ui_util.c +++ b/crypto/ui/ui_util.c @@ -71,12 +71,15 @@ int UI_UTIL_read_pw(char *buf,char *buff,int size,const char *prompt,int verify) int ok = 0; UI *ui; + if (size < 1) + return -1; + ui = UI_new(); if (ui) { - ok = UI_add_input_string(ui,prompt,0,buf,0,BUFSIZ-1); + ok = UI_add_input_string(ui,prompt,0,buf,0,size-1); if (ok == 0 && verify) - ok = UI_add_verify_string(ui,prompt,0,buff,0,BUFSIZ-1, + ok = UI_add_verify_string(ui,prompt,0,buff,0,size-1, buf); if (ok == 0) ok=UI_process(ui);