summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffan Karger <steffan@karger.me>2015-09-21 22:04:19 +0200
committerGert Doering <gert@greenie.muc.de>2015-10-04 21:55:38 +0200
commit5584b738a332d0abc740d9303c275764c2ca13f1 (patch)
treead3d13dc63a2d92875825782e7d1cac7fc9183f8
parentddc7692d245017c71adc40ad5cc195617e39fce0 (diff)
downloadopenvpn-5584b738a332d0abc740d9303c275764c2ca13f1.zip
openvpn-5584b738a332d0abc740d9303c275764c2ca13f1.tar.gz
openvpn-5584b738a332d0abc740d9303c275764c2ca13f1.tar.xz
Check return value of ms_error_text()
ms_error_text() may return NULL, and it is unclear (or, at least undocumented) whether the OpenSSL ERR code (and our code using the ERR code) can deal with esd->string being NULL. So, just to be sure, check that ms_error_text() succeeded before passing the result to ERR_load_strings(). Signed-off-by: Steffan Karger <steffan@karger.me> Acked-by: Gert Doering <gert@greenie.muc.de> Message-Id: <561130FC.8090008@karger.me> URL: http://article.gmane.org/gmane.network.openvpn.devel/10176 Signed-off-by: Gert Doering <gert@greenie.muc.de>
-rw-r--r--src/openvpn/cryptoapi.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/openvpn/cryptoapi.c b/src/openvpn/cryptoapi.c
index 1d54ee7..853c07b 100644
--- a/src/openvpn/cryptoapi.c
+++ b/src/openvpn/cryptoapi.c
@@ -164,6 +164,7 @@ static void err_put_ms_error(DWORD ms_err, int func, const char *file, int line)
err_map[i].ms_err = ms_err;
err_map[i].err = esd->error = i + 100;
esd->string = ms_error_text(ms_err);
+ check_malloc_return(esd->string);
ERR_load_strings(ERR_LIB_CRYPTOAPI, esd);
ERR_PUT_error(ERR_LIB_CRYPTOAPI, func, err_map[i].err, file, line);
break;