Fix #24577 correctly, cfg->code_len is the size of the code, while cfg->code_size is the size of the memory area allocated for code.