summaryrefslogtreecommitdiffhomepage
path: root/src/process
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2024-08-29 02:02:20 +0000
committermidipix <writeonce@midipix.org>2024-08-29 02:02:20 +0000
commitc88b65726f727524d4188c80b23af99b3115b2f2 (patch)
tree544d48e74d06393609d44c64a5f911d2933b98e6 /src/process
parent3986dfdd1a3ff58f80ca8f6e8607903857536c4a (diff)
downloadntapi-c88b65726f727524d4188c80b23af99b3115b2f2.tar.bz2
ntapi-c88b65726f727524d4188c80b23af99b3115b2f2.tar.xz
__ntapi_tt_get_argv_envp_utf16(): guard against repeated vector relocations.
Diffstat (limited to 'src/process')
-rw-r--r--src/process/ntapi_tt_create_native_process_v1.c6
-rw-r--r--src/process/ntapi_tt_create_native_process_v2.c4
2 files changed, 10 insertions, 0 deletions
diff --git a/src/process/ntapi_tt_create_native_process_v1.c b/src/process/ntapi_tt_create_native_process_v1.c
index 57ca36f..12f0073 100644
--- a/src/process/ntapi_tt_create_native_process_v1.c
+++ b/src/process/ntapi_tt_create_native_process_v1.c
@@ -238,6 +238,12 @@ int32_t __stdcall __ntapi_tt_create_native_process_v1(nt_create_process_params *
return __tt_create_process_cancel(params,hsection,status);
/* rtdata */
+ if (params->rtblock) {
+ struct _nt_runtime_data * rtdata;
+ rtdata = (struct _nt_runtime_data *)params->rtblock->addr;
+ rtdata->flags &= ~NT_RUNTIME_DATA_ARGV_ENVP_RELOCATED;
+ }
+
if (params->rtblock && (status = __ntapi_tt_create_remote_runtime_data(tparams.hprocess,params->rtblock)))
return __tt_create_process_cancel(params,hsection,status);
diff --git a/src/process/ntapi_tt_create_native_process_v2.c b/src/process/ntapi_tt_create_native_process_v2.c
index af683de..7214dc5 100644
--- a/src/process/ntapi_tt_create_native_process_v2.c
+++ b/src/process/ntapi_tt_create_native_process_v2.c
@@ -224,6 +224,10 @@ int32_t __stdcall __ntapi_tt_create_native_process_v2(
return NT_STATUS_SUCCESS;
/* rtdata */
+ struct _nt_runtime_data * rtdata;
+ rtdata = (struct _nt_runtime_data *)params->rtblock->addr;
+ rtdata->flags &= ~NT_RUNTIME_DATA_ARGV_ENVP_RELOCATED;
+
if ((status = __ntapi_tt_create_remote_runtime_data(params->hprocess,params->rtblock)))
return __tt_create_process_cancel(params,status);