From bed5bf8acc7d8da1e0551c2a70221ab4f62f58e5 Mon Sep 17 00:00:00 2001 From: Deon George Date: Fri, 24 Nov 2023 13:13:38 +1100 Subject: [PATCH] Binkp control frames can be NULL terminated. --- app/Classes/Protocol/Binkp.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Classes/Protocol/Binkp.php b/app/Classes/Protocol/Binkp.php index 8e03be7..519a2fb 100644 --- a/app/Classes/Protocol/Binkp.php +++ b/app/Classes/Protocol/Binkp.php @@ -431,7 +431,8 @@ final class Binkp extends BaseProtocol $rc = TRUE; } else { - $data = substr($this->rx_buf,1); + // http://ftsc.org/docs/fts-1026.001 - frames may be NULL terminated + $data = rtrim(substr($this->rx_buf,1),"\x00"); switch ($msg) { case self::BPM_ADR: @@ -1224,7 +1225,8 @@ final class Binkp extends BaseProtocol } /** - * @throws \Exception + * @todo It appears when we poll a node, we dont ask for passwords, but we still send echomail and files. + * @todo We should only send netmail if unauthenticated */ private function M_pwd(string $buf): bool {