From a4f4f01ca97293c8dbf9aeb7a06abb26c4b52c3f Mon Sep 17 00:00:00 2001 From: Ryo Suzumoto Date: Fri, 10 Mar 2023 18:36:16 +0900 Subject: [PATCH] removing_inappropriate_validation of DS --- Drivers/Super/driver_super.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Drivers/Super/driver_super.c b/Drivers/Super/driver_super.c index 2a103e75f..69a528fb5 100644 --- a/Drivers/Super/driver_super.c +++ b/Drivers/Super/driver_super.c @@ -1289,7 +1289,9 @@ static DS_ERR_CODE DS_validate_stream_config_(const DriverSuper* p_super, DS_Str if (p->settings.rx_buffer_ == NULL) return DS_ERR_CODE_ERR; if (p->settings.rx_buffer_->buffer == NULL) return DS_ERR_CODE_ERR; - if (p->settings.rx_buffer_->capacity < p_super->config.settings.rx_buffer_size_in_if_rx_) return DS_ERR_CODE_ERR; + // ↓ rx_buffer_size_in_if_rx_ が初期値の場合,大抵の場合ここで ERR となってしまう. + // rx_buffer_size_in_if_rx_ は通信中のビット反転で len の情報がおかしくなったときなど用なので, capacity との比較は一旦なしに + // if (p->settings.rx_buffer_->capacity < p_super->config.settings.rx_buffer_size_in_if_rx_) return DS_ERR_CODE_ERR; if (p->settings.rx_buffer_->capacity < p->settings.rx_frame_size_) return DS_ERR_CODE_ERR; if (p->settings.rx_buffer_->capacity < p->settings.rx_header_size_ + p->settings.rx_footer_size_) return DS_ERR_CODE_ERR;