From 827e5baca717d9ff0736efb91e8e2bd0cf009b69 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Thu, 17 Oct 2024 07:05:23 +1300 Subject: [PATCH] libs/fst: Update from upstream --- libs/fst/fstapi.cc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/libs/fst/fstapi.cc b/libs/fst/fstapi.cc index b77745900a0..3b0b352337b 100644 --- a/libs/fst/fstapi.cc +++ b/libs/fst/fstapi.cc @@ -550,8 +550,9 @@ return(rc); static uint32_t fstReaderVarint32(FILE *f) { -int chk_len = 5; /* TALOS-2023-1783 */ -unsigned char buf[chk_len]; +const int chk_len_max = 5; /* TALOS-2023-1783 */ +int chk_len = chk_len_max; +unsigned char buf[chk_len_max]; unsigned char *mem = buf; uint32_t rc = 0; int ch; @@ -582,8 +583,9 @@ return(rc); static uint32_t fstReaderVarint32WithSkip(FILE *f, uint32_t *skiplen) { -int chk_len = 5; /* TALOS-2023-1783 */ -unsigned char buf[chk_len]; +const int chk_len_max = 5; /* TALOS-2023-1783 */ +int chk_len = chk_len_max; +unsigned char buf[chk_len_max]; unsigned char *mem = buf; uint32_t rc = 0; int ch; @@ -615,8 +617,9 @@ return(rc); static uint64_t fstReaderVarint64(FILE *f) { -int chk_len = 16; /* TALOS-2023-1783 */ -unsigned char buf[chk_len]; +const int chk_len_max = 16; /* TALOS-2023-1783 */ +int chk_len = chk_len_max; +unsigned char buf[chk_len_max]; unsigned char *mem = buf; uint64_t rc = 0; int ch;