summaryrefslogtreecommitdiff
path: root/lib/libcrypto
diff options
context:
space:
mode:
authorRay Lai <ray@cvs.openbsd.org>2007-04-06 18:35:17 +0000
committerRay Lai <ray@cvs.openbsd.org>2007-04-06 18:35:17 +0000
commitba18005ff57e527e692f79e4e170c2a16f91411c (patch)
tree1164da66d9b93242fffa5a4d5bf67ddb87590090 /lib/libcrypto
parent4be31d069e2a623a24ce211c592507babf7f8f11 (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.c3
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);
}