From 5c70a63e02ae26bdfae14444d91f5f96bf74f505 Mon Sep 17 00:00:00 2001 From: David Timber Date: Wed, 14 Jul 2021 11:06:56 +1000 Subject: Impl proone-htbtclient, htbt bugfixes ... * htbt * Fix stdout-stderr round-robin sending algo in htbt_relay_child() * Fix logic error and crash bug in htbt_slv_srv_bin() * Impl proone-htbtclient runcmd command * Change signature of prne_htbt_set_cmd() --- src/protocol.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/protocol.c') diff --git a/src/protocol.c b/src/protocol.c index 6598ad8..cc1fc0d 100644 --- a/src/protocol.c +++ b/src/protocol.c @@ -396,7 +396,7 @@ ERR: return false; } -bool prne_htbt_set_cmd (prne_htbt_cmd_t *cmd, char **const args) { +bool prne_htbt_set_cmd (prne_htbt_cmd_t *cmd, const char **args) { size_t *args_len = NULL; size_t i, argc; bool ret = true; @@ -698,6 +698,10 @@ prne_htbt_ser_rc_t prne_htbt_ser_bin_meta ( { *actual = in->cmd.mem_len + 5; + if (in->bin_size > PRNE_HTBT_BIN_LEN_MAX) { + return PRNE_HTBT_SER_RC_FMT_ERR; + } + if (mem_len < *actual) { return PRNE_HTBT_SER_RC_MORE_BUF; } -- cgit