Fix potential buffer overrun introduced by query config patch.