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>