Add type 'x' in Field::decode.

type 'x' means byte array (array of unsigned chars) so it is strictly not correct to return a LongString (array of signed chars). But with this change the library can continue going after receiving type 'x'. The original code crashes or starts doing undefined things when receiving a nonempty byte array from a client.
This commit is contained in:
DHP86 2025-06-23 14:58:32 +02:00
parent ca49382bfc
commit 71abd6d1d1
1 changed files with 1 additions and 0 deletions

View File

@ -43,6 +43,7 @@ std::unique_ptr<Field> Field::decode(InBuffer &frame)
case 'T': return std::unique_ptr<Field>(new Timestamp(frame));
case 'F': return std::unique_ptr<Field>(new Table(frame));
case 'V': return std::unique_ptr<Field>(new VoidField(frame));
case 'x': return std::unique_ptr<Field>(new LongString(frame));
default: return nullptr;
}
}