aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2017-10-31 13:49:35 +0900
committerKazuki Yamaguchi <k@rhe.jp>2017-10-31 13:49:35 +0900
commite6c64eea1e67361f0e39e06c7df918368f649ab9 (patch)
tree80fdbb813fa6163ac87415c70ea2d25c73142ca5
parentffd23209933ea0ad5543f15ca6303d63d8dac826 (diff)
downloadopenssl-ky/pem-read-fix-unsigned-cast.tar.gz
Prevent infinite loop when reading PEMky/pem-read-fix-unsigned-cast
BIO_gets() may return a negative number on failure. Do not cast into an unsigned type before checking it.
-rw-r--r--crypto/pem/pem_lib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/pem/pem_lib.c b/crypto/pem/pem_lib.c
index 97b8a0d7c0..a4d7c34c8e 100644
--- a/crypto/pem/pem_lib.c
+++ b/crypto/pem/pem_lib.c
@@ -729,7 +729,7 @@ static int get_name(BIO *bp, char **name, unsigned int flags)
{
char *linebuf;
int ret = 0;
- size_t len;
+ int len;
/*
* Need to hold trailing NUL (accounted for by BIO_gets() and the newline