From fab30887212d86bbc5be0dc93215ae873db02552 Mon Sep 17 00:00:00 2001 From: zs <84500316@qq.com> Date: Wed, 17 Aug 2016 13:45:11 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3Golang=EF=BC=88WINDOWS?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0)=E8=B0=83=E7=94=A8openssl=20X509=5FSTORE=5Fl?= =?UTF-8?q?oad=5Flocations=E5=87=BD=E6=95=B0=E6=97=B6=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E4=BC=A0=E9=80=92NULL=E6=8C=87=E9=92=88=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E8=AF=A5=E5=87=BD=E6=95=B0=E8=BF=94=E5=9B=9E=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E3=80=82=20PS:Linux=E5=B9=B3=E5=8F=B0=E6=97=A0=E6=AD=A4?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crypto/x509/x509_d2.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crypto/x509/x509_d2.c b/crypto/x509/x509_d2.c index 50ca2a6d..8706c2c6 100644 --- a/crypto/x509/x509_d2.c +++ b/crypto/x509/x509_d2.c @@ -86,6 +86,13 @@ int X509_STORE_load_locations(X509_STORE *ctx, const char *file, const char *path) { X509_LOOKUP *lookup; + + //Support Go: + //Go调用此函数无法传递NULL指针,只能传递空串。 + if (file && *file == '\0') + file = NULL; + if (path && *path == '\0') + path = NULL if (file != NULL) { lookup = X509_STORE_add_lookup(ctx, X509_LOOKUP_file());