{"schema":"libjg2-1",
"vpath":"/git/",
"avatar":"/git/avatar/",
"alang":"",
"gen_ut":1747627484,
"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":"add3818aecfb92ee79d16f0efe54c33f",
"commit": {"type":"commit",
"time": 1542972954,
"time_ofs": 60,
"oid_tree": { "oid": "2276627c89c1623caf5cf5276119d304ce7a0e4c", "alias": []},
"oid":{ "oid": "cae2a7ca4289d4bdd5fbbc25406736f36bcfee7a", "alias": []},
"msg": "Smarter build of system error text database",
"sig_commit": { "git_time": { "time": 1542972954, "offset": 60 }, "name": "Richard Levitte", "email": "levitte@openssl.org", "md5": "b737120f0642a6a5c30c6291e6170c77" },
"sig_author": { "git_time": { "time": 1542821153, "offset": 60 }, "name": "Richard Levitte", "email": "levitte@openssl.org", "md5": "b737120f0642a6a5c30c6291e6170c77" }},
"body": "Smarter build of system error text database\n\nWe stored copies of the system error texts in a fixed line size array,\nwhich is a huge waste. Instead, use a static memory pool and pack all\nthe string in there. The wasted space at the end, if any, gives us\nsome leeway for longer strings than we have measured so far.\n\nReviewed-by: Matt Caswell \u003cmatt@openssl.org\u003e\n(Merged from https://github.com/openssl/openssl/pull/7681)\n\n(cherry picked from commit 2c5b6bbb6797242f43b5a986e1c018943e5c1305)\n"
,
"diff": "diff --git a/crypto/err/err.c b/crypto/err/err.c\nindex 03cbd73..ffdc140 100644\n--- a/crypto/err/err.c\n+++ b/crypto/err/err.c\n@@ -181,8 +181,9 @@ static ERR_STRING_DATA *int_err_get_item(const ERR_STRING_DATA *d)\n }\n \n #ifndef OPENSSL_NO_ERR\n+/* A measurement on Linux 2018-11-21 showed about 3.5kib */\n+# define SPACE_SYS_STR_REASONS 4 * 1024\n # define NUM_SYS_STR_REASONS 127\n-# define LEN_SYS_STR_REASON 32\n \n static ERR_STRING_DATA SYS_str_reasons[NUM_SYS_STR_REASONS + 1];\n /*\n@@ -198,7 +199,9 @@ static ERR_STRING_DATA SYS_str_reasons[NUM_SYS_STR_REASONS + 1];\n static void build_SYS_str_reasons(void)\n {\n /* OPENSSL_malloc cannot be used here, use static storage instead */\n- static char strerror_tab[NUM_SYS_STR_REASONS][LEN_SYS_STR_REASON];\n+ static char strerror_pool[SPACE_SYS_STR_REASONS];\n+ char *cur \u003d strerror_pool;\n+ size_t cnt \u003d 0;\n static int init \u003d 1;\n int i;\n \n@@ -213,9 +216,15 @@ static void build_SYS_str_reasons(void)\n \n str-\u003eerror \u003d ERR_PACK(ERR_LIB_SYS, 0, i);\n if (str-\u003estring \u003d\u003d NULL) {\n- char (*dest)[LEN_SYS_STR_REASON] \u003d \u0026(strerror_tab[i - 1]);\n- if (openssl_strerror_r(i, *dest, sizeof(*dest)))\n- str-\u003estring \u003d *dest;\n+ if (openssl_strerror_r(i, cur, sizeof(strerror_pool) - cnt)) {\n+ size_t l \u003d strlen(cur) + 1;\n+\n+ str-\u003estring \u003d cur;\n+ cnt +\u003d l;\n+ if (cnt \u003e sizeof(strerror_pool))\n+ cnt \u003d sizeof(strerror_pool);\n+ cur +\u003d l;\n+ }\n }\n if (str-\u003estring \u003d\u003d NULL)\n str-\u003estring \u003d \u0022unknown\u0022;\n","s":{"c":1747627484,"u": 38932}}
],"g": 40346,"chitpc": 0,"ehitpc": 0,"indexed":0
,
"ab": 0, "si": 0, "db":0, "di":0, "sat":0, "lfc": "0000"}