Commits


flashzxi authored and GitHub committed 1302889c01b
GH-43124: [C++] Initialize offset vector head as 0 after memory allocated in grouper.cc (#43123) ## bug description In grouper.cc:780, memory is allocated for offset vector of varlen column, however the vector is initialized in `encoder_.DecodeFixedLengthBuffers`, which will never be called when `num_groups==0`(see line 786). Then `fixedlen_bufs[i][0]` will be a uninitialized value that means a random uint32_t. Later this random uint32_t is used to `AllocatePaddedBuffer(varlen_size)`. However an random uint32_t is up to 4GB memory, the program may run normally without being affected. ## how to fix set offset vector head as 0 after memory allocated in case it won't be initialized when `num_groups==0` * GitHub Issue: #43124 Lead-authored-by: FlashZXi <flashzxi@outlook.com> Co-authored-by: Rossi Sun <zanmato1984@gmail.com> Co-authored-by: Ruoxi Sun <zanmato1984@gmail.com> Signed-off-by: Ruoxi Sun <zanmato1984@gmail.com>