[openssl-commits] [openssl] master update

kaduk at mit.edu kaduk at mit.edu
Fri Mar 9 17:00:20 UTC 2018

The branch master has been updated
       via  b0143b97529959470c90df157368c2925180e3c3 (commit)
      from  37933acbeafef6db9a5c5681c1b5174cd91494bc (commit)

- Log -----------------------------------------------------------------
commit b0143b97529959470c90df157368c2925180e3c3
Author: Benjamin Kaduk <bkaduk at akamai.com>
Date:   Tue Jan 30 12:55:44 2018 -0600

    Fix type error in PEM processing
    The get_name() helper was using a variable of type size_t to hold the
    result of BIO_gets(), but BIO_gets() returns int and makes use of negative
    values to indicate error conditions.
    Change the type of the local variable to match, and propagate that
    through to other places in the file to avoid -Wsign-compare issues.
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/5211)


Summary of changes:
 crypto/pem/pem_lib.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/crypto/pem/pem_lib.c b/crypto/pem/pem_lib.c
index 97b8a0d..1f0f8d6 100644
--- a/crypto/pem/pem_lib.c
+++ b/crypto/pem/pem_lib.c
@@ -722,14 +722,14 @@ static int sanitize_line(char *linebuf, int len, unsigned int flags)
 static const char beginstr[] = "-----BEGIN ";
 static const char endstr[] = "-----END ";
 static const char tailstr[] = "-----\n";
-#define BEGINLEN (sizeof(beginstr) - 1)
-#define ENDLEN (sizeof(endstr) - 1)
-#define TAILLEN (sizeof(tailstr) - 1)
+#define BEGINLEN ((int)(sizeof(beginstr) - 1))
+#define ENDLEN ((int)(sizeof(endstr) - 1))
+#define TAILLEN ((int)(sizeof(tailstr) - 1))
 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

More information about the openssl-commits mailing list