{"schema":"libjg2-1",
"vpath":"/git/",
"avatar":"/git/avatar/",
"alang":"",
"gen_ut":1755805283,
"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":"228942c278f806c4b74b49b355f56f77",
"commit": {"type":"commit",
"time": 1459362308,
"time_ofs": 120,
"oid_tree": { "oid": "0e50cde9c606af2f8344c9fd9eed6bcb5c3d0746", "alias": []},
"oid":{ "oid": "fcd9c8c0149d989bf0ab28e14bbaa49e5060db9b", "alias": []},
"msg": "Fix pointer size issues on VMS",
"sig_commit": { "git_time": { "time": 1459362308, "offset": 120 }, "name": "Richard Levitte", "email": "levitte@openssl.org", "md5": "b737120f0642a6a5c30c6291e6170c77" },
"sig_author": { "git_time": { "time": 1459312837, "offset": 120 }, "name": "Richard Levitte", "email": "levitte@openssl.org", "md5": "b737120f0642a6a5c30c6291e6170c77" }},
"body": "Fix pointer size issues on VMS\n\nOn VMS, the C compiler can work with 32-bit and 64-bit pointers, and\nthe command line determines what the initial pointer size shall be.\n\nHowever, there is some functionality that only works with 32-bit\npointers. In this case, it's gethostbyname(), getservbyname() and\naccompanying structures, so we need to make sure that we define our\nown pointers as 32-bit ones.\n\nFurthermore, there seems to be a bug in VMS C netdb.h, where struct\naddrinfo is always defined with 32-bit pointers no matter what, but\nthe functions handling it are adapted to the initial pointer size.\nThis leads to pointer size warnings when compiling with\n/POINTER_SIZE\u003d64. The workaround is to force struct addrinfo to be\nthe 64-bit variant if the initial pointer size is 64.\n\nReviewed-by: Andy Polyakov \u003cappro@openssl.org\u003e\n"
,
"diff": "diff --git a/crypto/bio/b_addr.c b/crypto/bio/b_addr.c\nindex 663ec2e..ed4c139 100644\n--- a/crypto/bio/b_addr.c\n+++ b/crypto/bio/b_addr.c\n@@ -722,6 +722,15 @@ int BIO_lookup(const char *host, const char *service,\n } else {\n #endif\n const struct hostent *he;\n+/*\n+ * Because struct hostent is defined for 32-bit pointers only with\n+ * VMS C, we need to make sure that '\u0026he_fallback_address' and\n+ * '\u0026he_fallback_addresses' are 32-bit pointers\n+ */\n+#if defined(OPENSSL_SYS_VMS) \u0026\u0026 defined(__DECC)\n+# pragma pointer_size save\n+# pragma pointer_size 32\n+#endif\n /* Windows doesn't seem to have in_addr_t */\n #ifdef OPENSSL_SYS_WINDOWS\n static uint32_t he_fallback_address;\n@@ -735,6 +744,10 @@ int BIO_lookup(const char *host, const char *service,\n static const struct hostent he_fallback \u003d\n { NULL, NULL, AF_INET, sizeof(he_fallback_address),\n (char **)\u0026he_fallback_addresses };\n+#if defined(OPENSSL_SYS_VMS) \u0026\u0026 defined(__DECC)\n+# pragma pointer_size restore\n+#endif\n+\n struct servent *se;\n /* Apprently, on WIN64, s_proto and s_port have traded places... */\n #ifdef _WIN64\n@@ -782,7 +795,19 @@ int BIO_lookup(const char *host, const char *service,\n } else {\n char *endp \u003d NULL;\n long portnum \u003d strtol(service, \u0026endp, 10);\n+\n+/*\n+ * Because struct servent is defined for 32-bit pointers only with\n+ * VMS C, we need to make sure that 'proto' is a 32-bit pointer.\n+ */\n+#if defined(OPENSSL_SYS_VMS) \u0026\u0026 defined(__DECC)\n+# pragma pointer_size save\n+# pragma pointer_size 32\n+#endif\n char *proto \u003d NULL;\n+#if defined(OPENSSL_SYS_VMS) \u0026\u0026 defined(__DECC)\n+# pragma pointer_size restore\n+#endif\n \n switch (socktype) {\n case SOCK_STREAM:\n@@ -819,7 +844,19 @@ int BIO_lookup(const char *host, const char *service,\n *res \u003d NULL;\n \n {\n+/*\n+ * Because hostent::h_addr_list is an array of 32-bit pointers with VMS C,\n+ * we must make sure our iterator designates the same element type, hence\n+ * the pointer size dance.\n+ */\n+#if defined(OPENSSL_SYS_VMS) \u0026\u0026 defined(__DECC)\n+# pragma pointer_size save\n+# pragma pointer_size 32\n+#endif\n char **addrlistp;\n+#if defined(OPENSSL_SYS_VMS) \u0026\u0026 defined(__DECC)\n+# pragma pointer_size restore\n+#endif\n size_t addresses;\n BIO_ADDRINFO *tmp_bai \u003d NULL;\n \ndiff --git a/crypto/bio/bio_lcl.h b/crypto/bio/bio_lcl.h\nindex 1e409f8..7f3b222 100644\n--- a/crypto/bio/bio_lcl.h\n+++ b/crypto/bio/bio_lcl.h\n@@ -32,6 +32,18 @@\n # endif\n \n # ifdef AI_PASSIVE\n+\n+/*\n+ * There's a bug in VMS C header file netdb.h, where struct addrinfo\n+ * always is the P32 variant, but the functions that handle that structure,\n+ * such as getaddrinfo() and freeaddrinfo() adapt to the initial pointer\n+ * size. The easiest workaround is to force struct addrinfo to be the\n+ * 64-bit variant when compiling in P64 mode.\n+ */\n+# if defined(OPENSSL_SYS_VMS) \u0026\u0026 __INITIAL_POINTER_SIZE \u003d\u003d 64\n+# define addrinfo __addrinfo64\n+# endif\n+\n # define bio_addrinfo_st addrinfo\n # define bai_family ai_family\n # define bai_socktype ai_socktype\n","s":{"c":1755805283,"u": 2830}}
],"g": 3956,"chitpc": 0,"ehitpc": 0,"indexed":0
,
"ab": 0, "si": 0, "db":0, "di":0, "sat":0, "lfc": "0000"}