From e2c637cf489e902bec6b084618fe7e847ab3848a Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 26 Sep 2025 23:26:54 -0500 Subject: [PATCH] stack it --- esphome/components/esphome/ota/ota_esphome.cpp | 4 ++-- esphome/components/esphome/ota/ota_esphome.h | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/esphome/components/esphome/ota/ota_esphome.cpp b/esphome/components/esphome/ota/ota_esphome.cpp index b7dbed4e19..b39ab5222a 100644 --- a/esphome/components/esphome/ota/ota_esphome.cpp +++ b/esphome/components/esphome/ota/ota_esphome.cpp @@ -725,8 +725,8 @@ bool ESPHomeOTAComponent::prepare_auth_nonce_(HashBase *hasher) { const size_t hex_size = hasher->get_size() * 2; const size_t nonce_len = hasher->get_size() / 4; // Buffer needs: 1 (auth_type) + hex_size (nonce) + hex_size*2 (cnonce+response) - this->auth_buf_size_ = 1 + hex_size + hex_size * 2; - this->auth_buf_ = std::make_unique(this->auth_buf_size_); + const size_t auth_buf_size = 1 + hex_size + hex_size * 2; + this->auth_buf_ = std::make_unique(auth_buf_size); this->auth_buf_pos_ = 0; // Generate nonce diff --git a/esphome/components/esphome/ota/ota_esphome.h b/esphome/components/esphome/ota/ota_esphome.h index 15d1aac914..ce19d52253 100644 --- a/esphome/components/esphome/ota/ota_esphome.h +++ b/esphome/components/esphome/ota/ota_esphome.h @@ -83,7 +83,6 @@ class ESPHomeOTAComponent : public ota::OTAComponent { uint8_t ota_features_{0}; #ifdef USE_OTA_PASSWORD std::unique_ptr auth_buf_; - size_t auth_buf_size_{0}; size_t auth_buf_pos_{0}; uint8_t auth_type_{0}; // Store auth type to know which hasher to use #endif // USE_OTA_PASSWORD