diff options
author | ray <> | 2007-04-06 18:35:16 +0000 |
---|---|---|
committer | ray <> | 2007-04-06 18:35:16 +0000 |
commit | 266fea10f61028485df1b5efc9e8fe08970798c1 (patch) | |
tree | 759c9dcfd1cffddbbf72eebe4e9ac826c2fbb910 /src/lib | |
parent | 36488448c3ca3d9f15fafdf14791736a99d87384 (diff) | |
download | openbsd-266fea10f61028485df1b5efc9e8fe08970798c1.tar.gz openbsd-266fea10f61028485df1b5efc9e8fe08970798c1.tar.bz2 openbsd-266fea10f61028485df1b5efc9e8fe08970798c1.zip |
Add proper checks against fgets failure. From Charles Longeau.
OK moritz@, millert@, and jaredy@.
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libcrypto/ui/ui_openssl.c | 3 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/ui/ui_openssl.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/libcrypto/ui/ui_openssl.c b/src/lib/libcrypto/ui/ui_openssl.c index 75318d48a1..d03aeba91a 100644 --- a/src/lib/libcrypto/ui/ui_openssl.c +++ b/src/lib/libcrypto/ui/ui_openssl.c | |||
@@ -383,7 +383,8 @@ static void read_till_nl(FILE *in) | |||
383 | char buf[SIZE+1]; | 383 | char buf[SIZE+1]; |
384 | 384 | ||
385 | do { | 385 | do { |
386 | fgets(buf,SIZE,in); | 386 | if (fgets(buf,sizeof(buf),in) == NULL) |
387 | break; | ||
387 | } while (strchr(buf,'\n') == NULL); | 388 | } while (strchr(buf,'\n') == NULL); |
388 | } | 389 | } |
389 | 390 | ||
diff --git a/src/lib/libssl/src/crypto/ui/ui_openssl.c b/src/lib/libssl/src/crypto/ui/ui_openssl.c index 75318d48a1..d03aeba91a 100644 --- a/src/lib/libssl/src/crypto/ui/ui_openssl.c +++ b/src/lib/libssl/src/crypto/ui/ui_openssl.c | |||
@@ -383,7 +383,8 @@ static void read_till_nl(FILE *in) | |||
383 | char buf[SIZE+1]; | 383 | char buf[SIZE+1]; |
384 | 384 | ||
385 | do { | 385 | do { |
386 | fgets(buf,SIZE,in); | 386 | if (fgets(buf,sizeof(buf),in) == NULL) |
387 | break; | ||
387 | } while (strchr(buf,'\n') == NULL); | 388 | } while (strchr(buf,'\n') == NULL); |
388 | } | 389 | } |
389 | 390 | ||