{"schema":"libjg2-1",
"vpath":"/git/",
"avatar":"/git/avatar/",
"alang":"",
"gen_ut":1746504966,
"reponame":"sai",
"desc":"Sai lightweight distributed CI",
"owner": { "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },"url":"https://warmcat.com/repo/sai",
"f":3,
"items": [
{"schema":"libjg2-1",
"cid":"5d03ff636c48a8a47b333b34564fff8d",
"commit": {"type":"commit",
"time": 1603121703,
"time_ofs": 60,
"oid_tree": { "oid": "7a20abf32320598338cbd82f80b84cf627c8e4e5", "alias": []},
"oid":{ "oid": "22e6d5212b5c90b460bfbf33594652c9849454c7", "alias": []},
"msg": "spawn: in discrete env setting case do it readonly",
"sig_commit": { "git_time": { "time": 1603121703, "offset": 60 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },
"sig_author": { "git_time": { "time": 1602933616, "offset": 60 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" }},
"body": "spawn: in discrete env setting case do it readonly\n\nOSX changed to blow a segfault on write to .rodata, exposing that\nwe're dropping a NUL in what can be .rodata to set the environment\nmanually. We don't do this on Linux typically because we take the\ncode path where execvpe() is available to do the env for us.\n\nAdapt the code to treat it as const, and underscore it by changing\nits type to be const char ** in the info struct.\n"
,
"diff": "diff --git a/include/libwebsockets/lws-misc.h b/include/libwebsockets/lws-misc.h\nindex 073108a..d8519d2 100644\n--- a/include/libwebsockets/lws-misc.h\n+++ b/include/libwebsockets/lws-misc.h\n@@ -895,7 +895,7 @@ struct lws_spawn_piped_info {\n \tstruct lws\t\t\t*opt_parent;\n \n \tconst char * const\t\t*exec_array;\n-\tchar\t\t\t\t**env_array;\n+\tconst char\t\t\t**env_array;\n \tconst char\t\t\t*protocol_name;\n \tconst char\t\t\t*chroot_path;\n \tconst char\t\t\t*wd;\ndiff --git a/lib/plat/unix/unix-spawn.c b/lib/plat/unix/unix-spawn.c\nindex 1e3a01e..bfa0fc9 100644\n--- a/lib/plat/unix/unix-spawn.c\n+++ b/lib/plat/unix/unix-spawn.c\n@@ -528,16 +528,19 @@ lws_spawn_piped(const struct lws_spawn_piped_info *i)\n #if defined(__linux__) || defined(__APPLE__)\n \tm \u003d 0;\n \twhile (i-\u003eenv_array[m]){\n-\t\tchar *p \u003d strchr(i-\u003eenv_array[m], '\u003d');\n-\t\t*p++ \u003d '\u005c0';\n-\t\tsetenv(i-\u003eenv_array[m], p, 1);\n+\t\tconst char *p \u003d strchr(i-\u003eenv_array[m], '\u003d');\n+\t\tint naml \u003d lws_ptr_diff(p, i-\u003eenv_array[m]);\n+\t\tchar enam[32];\n+\n+\t\tlws_strnncpy(enam, i-\u003eenv_array[m], naml, sizeof(enam));\n+\t\tsetenv(enam, p, 1);\n \t\tm++;\n \t}\n #endif\n \texecvp(i-\u003eexec_array[0], (char * const *)\u0026i-\u003eexec_array[0]);\n #else\n \texecvpe(i-\u003eexec_array[0], (char * const *)\u0026i-\u003eexec_array[0],\n-\t\t\u0026i-\u003eenv_array[0]);\n+\t\t(char **)\u0026i-\u003eenv_array[0]);\n #endif\n \n \tlwsl_err(\u0022%s: child exec of %s failed %d\u005cn\u0022, __func__, i-\u003eexec_array[0],\ndiff --git a/lib/roles/cgi/cgi-server.c b/lib/roles/cgi/cgi-server.c\nindex 5a39116..1aa2f9c 100644\n--- a/lib/roles/cgi/cgi-server.c\n+++ b/lib/roles/cgi/cgi-server.c\n@@ -385,7 +385,7 @@ lws_cgi(struct lws *wsi, const char * const *exec_array,\n #endif\n \n \tmemset(\u0026info, 0, sizeof(info));\n-\tinfo.env_array \u003d env_array;\n+\tinfo.env_array \u003d (const char **)env_array;\n \tinfo.exec_array \u003d exec_array;\n \tinfo.max_log_lines \u003d 20000;\n \tinfo.opt_parent \u003d wsi;\n","s":{"c":1746425520,"u": 3705}}
],"g": 731,"chitpc": 0,"ehitpc": 0,"indexed":0
,
"ab": 0, "si": 0, "db":0, "di":0, "sat":0, "lfc": "7d0a"}