From 0d5e4ba4f1fd03e63043711021408ef4c6a4ead4 Mon Sep 17 00:00:00 2001 From: Roman Janota Date: Tue, 7 Apr 2026 08:31:56 +0000 Subject: [PATCH 1/3] session openssl BUGFIX handle NULL from ERR_reason_error_string Fixes #588 --- src/session_openssl.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/session_openssl.c b/src/session_openssl.c index 2b4a0842..6484a526 100644 --- a/src/session_openssl.c +++ b/src/session_openssl.c @@ -1035,10 +1035,17 @@ nc_tls_get_err_reasons(void) unsigned int e; int reason_size, reason_len; char *reasons = NULL; + const char *err_reason; reason_size = 1; reason_len = 0; while ((e = ERR_get_error())) { + err_reason = ERR_reason_error_string(e); + if (!err_reason) { + /* couldn't map value to anything from https://datatracker.ietf.org/doc/html/rfc8446#appendix-B.2 */ + DBG(NULL, "Unknown OpenSSL error (err code %u).", e); + err_reason = "unknown AlertDescription value"; + } if (reason_len) { /* add "; " */ reason_size += 2; @@ -1046,10 +1053,10 @@ nc_tls_get_err_reasons(void) NC_CHECK_ERRMEM_RET(!reasons, NULL); reason_len += sprintf(reasons + reason_len, "; "); } - reason_size += strlen(ERR_reason_error_string(e)); + reason_size += strlen(err_reason); reasons = nc_realloc(reasons, reason_size); NC_CHECK_ERRMEM_RET(!reasons, NULL); - reason_len += sprintf(reasons + reason_len, "%s", ERR_reason_error_string(e)); + reason_len += sprintf(reasons + reason_len, "%s", err_reason); } return reasons; From 514c0d427ace31558bb450c30ae00c25d8f39f79 Mon Sep 17 00:00:00 2001 From: Roman Janota Date: Tue, 7 Apr 2026 08:32:00 +0000 Subject: [PATCH 2/3] SOVERSION bump to version 5.3.4 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 15be22bf..916dca82 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,7 +66,7 @@ set(LIBNETCONF2_VERSION ${LIBNETCONF2_MAJOR_VERSION}.${LIBNETCONF2_MINOR_VERSION # with backward compatible change and micro version is connected with any internal change of the library. set(LIBNETCONF2_MAJOR_SOVERSION 5) set(LIBNETCONF2_MINOR_SOVERSION 3) -set(LIBNETCONF2_MICRO_SOVERSION 3) +set(LIBNETCONF2_MICRO_SOVERSION 4) set(LIBNETCONF2_SOVERSION_FULL ${LIBNETCONF2_MAJOR_SOVERSION}.${LIBNETCONF2_MINOR_SOVERSION}.${LIBNETCONF2_MICRO_SOVERSION}) set(LIBNETCONF2_SOVERSION ${LIBNETCONF2_MAJOR_SOVERSION}) From b64e1589250202c0116eb32184578858d0e1cd79 Mon Sep 17 00:00:00 2001 From: Roman Janota Date: Tue, 7 Apr 2026 08:32:03 +0000 Subject: [PATCH 3/3] VERSION bump to version 4.2.15 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 916dca82..da1460d0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,7 +58,7 @@ set(CMAKE_MACOSX_RPATH TRUE) # micro version is changed with a set of small changes or bugfixes anywhere in the project. set(LIBNETCONF2_MAJOR_VERSION 4) set(LIBNETCONF2_MINOR_VERSION 2) -set(LIBNETCONF2_MICRO_VERSION 14) +set(LIBNETCONF2_MICRO_VERSION 15) set(LIBNETCONF2_VERSION ${LIBNETCONF2_MAJOR_VERSION}.${LIBNETCONF2_MINOR_VERSION}.${LIBNETCONF2_MICRO_VERSION}) # Version of the library