[openssl-commits] [openssl] OpenSSL_1_1_1-stable update

Richard Levitte levitte at openssl.org
Sat Nov 24 16:43:36 UTC 2018


The branch OpenSSL_1_1_1-stable has been updated
       via  1119d4e7f4b1f9eeb0e50063081c516708e3ca72 (commit)
      from  6aca8d1a5fb1fa8b359d0ddeab636174c09bf534 (commit)


- Log -----------------------------------------------------------------
commit 1119d4e7f4b1f9eeb0e50063081c516708e3ca72
Author: Richard Levitte <levitte at openssl.org>
Date:   Sat Nov 24 13:08:56 2018 +0100

    VMS: fix collected error strings
    
    It turns out that on VMS, strerror() returns messages with added
    spaces at the end.
    
    We wouldn't had noticed if it wasn't for perl trimming those spaces
    off for its own sake and thereby having test/recipes/02-test_errstr.t
    fail on VMS.
    
    The safe fix is to do the same trimming ourselves.
    
    Reviewed-by: Paul Dale <paul.dale at oracle.com>
    (Merged from https://github.com/openssl/openssl/pull/7701)
    
    (cherry picked from commit 9f15e5b911ba6053e09578f190354568e01c07d7)

-----------------------------------------------------------------------

Summary of changes:
 crypto/err/err.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/crypto/err/err.c b/crypto/err/err.c
index ffdc140..34061bc 100644
--- a/crypto/err/err.c
+++ b/crypto/err/err.c
@@ -19,6 +19,7 @@
 #include <openssl/bio.h>
 #include <openssl/opensslconf.h>
 #include "internal/thread_once.h"
+#include "internal/ctype.h"
 
 static int err_load_strings(const ERR_STRING_DATA *str);
 
@@ -217,13 +218,24 @@ static void build_SYS_str_reasons(void)
         str->error = ERR_PACK(ERR_LIB_SYS, 0, i);
         if (str->string == NULL) {
             if (openssl_strerror_r(i, cur, sizeof(strerror_pool) - cnt)) {
-                size_t l = strlen(cur) + 1;
+                size_t l = strlen(cur);
 
                 str->string = cur;
                 cnt += l;
                 if (cnt > sizeof(strerror_pool))
                     cnt = sizeof(strerror_pool);
                 cur += l;
+
+                /*
+                 * VMS has an unusual quirk of adding spaces at the end of
+                 * some (most? all?) messages.  Lets trim them off.
+                 */
+                while (ossl_isspace(cur[-1])) {
+                    cur--;
+                    cnt--;
+                }
+                *cur++ = '\0';
+                cnt++;
             }
         }
         if (str->string == NULL)


More information about the openssl-commits mailing list