Closed morixhub closed 2 years ago
Can we use a quint16 instead of uchar?
or quint8
quint16
is not good since it does not fix the problem. quint8
instead works.
Probably there is something (at least on MSVC compiler) in the "promotion" from char
to quint16
than preserves the sign at some stage... quint8
instead performs a direct cast from char tu quint8
(which is an unsigned char
) which is good.
Cherry picked to master, closing
While browsing services on Windows (through Bonjour SDK) I discovered that I was unable to browser services if some of them published TXT records longer than 127 bytes (the maximum length of TXT records is actually 255 bytes).
The problem was due to the usage of a signed variable (
qint16
) while spooling the length of the TXT record out of the buffer, inQZeroConfPrivate::resolverCallback()
within bonjour.cpp file. If the length of the record was longer that 127 bytes, then it was interpreted as signed during the conversion toqint16
and hence generated a negative value for variablerecLen
, thus causing the execution to hang within the function.Changing the declaration type of
recLen
from qint16 touchar
fixed the problem.