aboutsummaryrefslogtreecommitdiff
path: root/pk/pk.c
diff options
context:
space:
mode:
Diffstat (limited to 'pk/pk.c')
-rw-r--r--pk/pk.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/pk/pk.c b/pk/pk.c
index a149a42..b8b0b1c 100644
--- a/pk/pk.c
+++ b/pk/pk.c
@@ -29,7 +29,7 @@ static void handle_option(const char* s)
}
}
-#define MAX_ARGS 64
+#define MAX_ARGS 256
typedef union {
uint64_t buf[MAX_ARGS];
char* argv[MAX_ARGS];
@@ -38,6 +38,9 @@ typedef union {
static size_t parse_args(arg_buf* args)
{
long r = frontend_syscall(SYS_getmainvars, va2pa(args), sizeof(*args), 0, 0, 0, 0, 0);
+ if (r != 0)
+ panic("args must not exceed %d bytes", (int)sizeof(arg_buf));
+
kassert(r == 0);
uint64_t* pk_argv = &args->buf[1];
// pk_argv[0] is the proxy kernel itself. skip it and any flags.