From 5462945cbf73fee12ac1994ac984a3f7e1a1fefa Mon Sep 17 00:00:00 2001 From: "Adam C. Emerson" Date: Wed, 25 Mar 2026 22:39:32 -0400 Subject: [PATCH] cls/otp: Replace VLA with `boost::container::small_vector` Signed-off-by: Adam C. Emerson --- src/cls/otp/cls_otp.cc | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/cls/otp/cls_otp.cc b/src/cls/otp/cls_otp.cc index 4dfca82556b..3e0e8432e1c 100644 --- a/src/cls/otp/cls_otp.cc +++ b/src/cls/otp/cls_otp.cc @@ -8,21 +8,17 @@ * */ -#include -#include +#include #include #include +#include + #include -#include "include/types.h" -#include "include/utime.h" #include "objclass/objclass.h" -#include "common/errno.h" -#include "common/Clock.h" - #include "cls/otp/cls_otp_ops.h" #include "cls/otp/cls_otp_types.h" @@ -268,8 +264,8 @@ static int write_header(cls_method_context_t hctx, const otp_header& h) static int parse_seed(const string& seed, SeedType seed_type, bufferlist *seed_bin) { size_t slen = seed.length(); - char secret[seed.length()]; - char *psecret = secret; + boost::container::small_vector secret(seed.length()); + char *psecret = secret.data(); int result; bool need_free = false; -- 2.47.3