diff options
author | Andrew Waterman <andrew@sifive.com> | 2019-05-09 11:58:15 -0700 |
---|---|---|
committer | Andrew Waterman <andrew@sifive.com> | 2019-05-09 11:58:48 -0700 |
commit | cb253a3f970b373df4390a0e7a17610556f920f3 (patch) | |
tree | cdeec747db424e00a8cdd9801eabb156a6fd7c71 | |
parent | 9239d63942b92c3568ebda26258e49d2acacd229 (diff) | |
download | pk-cb253a3f970b373df4390a0e7a17610556f920f3.zip pk-cb253a3f970b373df4390a0e7a17610556f920f3.tar.gz pk-cb253a3f970b373df4390a0e7a17610556f920f3.tar.bz2 |
Allow up to 2 KiB of arguments
Closes #161
-rw-r--r-- | pk/pk.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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. |