QSerialPortInfo FreeBSD: improve error handling in OID parsing


The sysctl() call can theoretically return a zero length or a length
that does not represent a whole amount of ints. In such case, the next
sysctl() would have accessed the first element of an empty array or
passed an incorrect length due to truncating. In both cases that could
lead to accessing the memory past the end of the allocated QList.

Note that it is unlikely to happen in practice, unless there's a bug
in the kernel, because on success at least one component should be
available.

Still, adding these guards won't hurt. But I'm not picking this patch
to ESM branches.

Task-number: QTBUG-144899
Pick-to: 6.12 6.11 6.8
Change-Id: I95d00da9eaa2e448283f810ae67bba48cf822af1
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
commitef91504c20fc99a84f813c84c4380242279aae4b
parent960e9da04ca07178cb246ea0a02d175093c26fa1
authorIvan Solovev <ivan.solovev@qt.io>
committerIvan Solovev <ivan.solovev@qt.io>
commit timeThu, 6 Aug 2026 08:25:05 +0000