1.1 --- a/libexec/lib/src/process_creator_context_resource.cc Wed Jan 24 21:12:41 2024 +0100
1.2 +++ b/libexec/lib/src/process_creator_context_resource.cc Wed Jan 24 21:17:37 2024 +0100
1.3 @@ -1,7 +1,7 @@
1.4 /*
1.5 * A resource offering support for creating processes.
1.6 *
1.7 - * Copyright (C) 2023 Paul Boddie <paul@boddie.org.uk>
1.8 + * Copyright (C) 2023, 2024 Paul Boddie <paul@boddie.org.uk>
1.9 *
1.10 * This program is free software; you can redistribute it and/or
1.11 * modify it under the terms of the GNU General Public License as
1.12 @@ -50,7 +50,8 @@
1.13
1.14 /* ProcessCreatorContext interface methods. */
1.15
1.16 -long ProcessCreatorContextResource::start(int argc, l4_cap_idx_t writer,
1.17 +long ProcessCreatorContextResource::start(int argc, l4_cap_idx_t reader,
1.18 + l4_cap_idx_t writer,
1.19 l4_cap_idx_t *process)
1.20 {
1.21 /* Obtain the arguments by reading from the shared memory. */
1.22 @@ -58,6 +59,9 @@
1.23 const char *argv[argc];
1.24 offset_t pos = 0;
1.25
1.26 + if (!argc)
1.27 + return -L4_EINVAL;
1.28 +
1.29 for (int i = 0; i < argc; i++)
1.30 {
1.31 argv[i] = get_string(pos);
1.32 @@ -89,7 +93,7 @@
1.33 reply, so a notification is sent via the process monitor instead by the
1.34 process creator. */
1.35
1.36 - _creator->start(argc, argv, writer, *process);
1.37 + _creator->start(argc, argv, reader, writer, *process);
1.38
1.39 return IPC_MESSAGE_SENT;
1.40 }