Project homepage Mailing List  Warmcat.com  API Docs  Github Mirror 
{"schema":"libjg2-1", "vpath":"/git/", "avatar":"/git/avatar/", "alang":"", "gen_ut":1750824794, "reponame":"openssl", "desc":"OpenSSL", "owner": { "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },"url":"https://warmcat.com/repo/openssl", "f":3, "items": [ {"schema":"libjg2-1", "cid":"e434f0b723d95e3580a42d44f5782726", "commit": {"type":"commit", "time": 1572988632, "time_ofs": 60, "oid_tree": { "oid": "4826edb4dd1529f30ed75e12c77ced8379fb1ecf", "alias": []}, "oid":{ "oid": "f6483fc2db36fbfd622b6aff19d8ebfaa274c996", "alias": []}, "msg": "BIO_s_connect: add an error state and use it", "sig_commit": { "git_time": { "time": 1572988632, "offset": 60 }, "name": "Richard Levitte", "email": "levitte@openssl.org", "md5": "b737120f0642a6a5c30c6291e6170c77" }, "sig_author": { "git_time": { "time": 1542118641, "offset": 60 }, "name": "Richard Levitte", "email": "levitte@openssl.org", "md5": "b737120f0642a6a5c30c6291e6170c77" }}, "body": "BIO_s_connect: add an error state and use it\n\nIf no connection could be made, addr_iter will eventually end up being\nNULL, and if the user didn't check the returned error value, the\nBIO_CONN_S_CONNECT code will be performed again and will crash.\n\nSo instead, we add a state BIO_CONN_S_CONNECT_ERROR that we enter into\nwhen we run out of addresses to try. That state will just simply say\n\u0022error\u0022 back, until the user does something better with the BIO, such\nas free it or reset it.\n\nReviewed-by: Matt Caswell \u003cmatt@openssl.org\u003e\n(Merged from https://github.com/openssl/openssl/pull/10333)\n" , "diff": "diff --git a/crypto/bio/bss_conn.c b/crypto/bio/bss_conn.c\nindex 264e25a..ad299ac 100644\n--- a/crypto/bio/bss_conn.c\n+++ b/crypto/bio/bss_conn.c\n@@ -54,6 +54,7 @@ void BIO_CONNECT_free(BIO_CONNECT *a);\n #define BIO_CONN_S_CONNECT 4\n #define BIO_CONN_S_OK 5\n #define BIO_CONN_S_BLOCKED_CONNECT 6\n+#define BIO_CONN_S_CONNECT_ERROR 7\n \n static const BIO_METHOD methods_connectp \u003d {\n BIO_TYPE_CONNECT,\n@@ -174,7 +175,8 @@ static int conn_state(BIO *b, BIO_CONNECT *c)\n ERR_add_error_data(4,\n \u0022hostname\u003d\u0022, c-\u003eparam_hostname,\n \u0022 service\u003d\u0022, c-\u003eparam_service);\n- BIOerr(BIO_F_CONN_STATE, BIO_R_CONNECT_ERROR);\n+ c-\u003estate \u003d BIO_CONN_S_CONNECT_ERROR;\n+ break;\n }\n goto exit_loop;\n } else {\n@@ -197,6 +199,11 @@ static int conn_state(BIO *b, BIO_CONNECT *c)\n c-\u003estate \u003d BIO_CONN_S_OK;\n break;\n \n+ case BIO_CONN_S_CONNECT_ERROR:\n+ BIOerr(BIO_F_CONN_STATE, BIO_R_CONNECT_ERROR);\n+ ret \u003d 0;\n+ goto exit_loop;\n+\n case BIO_CONN_S_OK:\n ret \u003d 1;\n goto exit_loop;\n","s":{"c":1750705480,"u": 63516}} ],"g": 659,"chitpc": 0,"ehitpc": 0,"indexed":0 , "ab": 0, "si": 0, "db":0, "di":0, "sat":0, "lfc": "7d0a"}