From b57c98df7b10234b185ef3c74be021a66eb52f10 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Thu, 11 Jul 2002 09:12:29 +0000 Subject: [PATCH] =?utf8?q?In=20UI=5FUTIL=5Fread=5Fpw(),=20we=20should=20lo?= =?utf8?q?ok=20at=20the=20size=20parameter,=20not=20at=20BUFSIZ.=20Submitt?= =?utf8?q?ed=20by=20G=C3=B6tz=20Babin-Ebell=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- crypto/ui/ui_util.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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); -- 2.34.1