diff options
author | Ray Lai <ray@cvs.openbsd.org> | 2007-04-06 18:35:17 +0000 |
---|---|---|
committer | Ray Lai <ray@cvs.openbsd.org> | 2007-04-06 18:35:17 +0000 |
commit | ba18005ff57e527e692f79e4e170c2a16f91411c (patch) | |
tree | 1164da66d9b93242fffa5a4d5bf67ddb87590090 /lib/libcrypto | |
parent | 4be31d069e2a623a24ce211c592507babf7f8f11 (diff) |
Add proper checks against fgets failure. From Charles Longeau.
OK moritz@, millert@, and jaredy@.
Diffstat (limited to 'lib/libcrypto')
-rw-r--r-- | lib/libcrypto/ui/ui_openssl.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libcrypto/ui/ui_openssl.c b/lib/libcrypto/ui/ui_openssl.c index 75318d48a14..d03aeba91ac 100644 --- a/lib/libcrypto/ui/ui_openssl.c +++ b/lib/libcrypto/ui/ui_openssl.c @@ -383,7 +383,8 @@ static void read_till_nl(FILE *in) char buf[SIZE+1]; do { - fgets(buf,SIZE,in); + if (fgets(buf,sizeof(buf),in) == NULL) + break; } while (strchr(buf,'\n') == NULL); } |