From 71abd6d1d19f2a2ff7c234d7b49dd781934ad47d Mon Sep 17 00:00:00 2001 From: DHP86 Date: Mon, 23 Jun 2025 14:58:32 +0200 Subject: [PATCH] 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. --- src/field.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/field.cpp b/src/field.cpp index 2d413ce..ceb5ef5 100644 --- a/src/field.cpp +++ b/src/field.cpp @@ -43,6 +43,7 @@ std::unique_ptr Field::decode(InBuffer &frame) case 'T': return std::unique_ptr(new Timestamp(frame)); case 'F': return std::unique_ptr(new Table(frame)); case 'V': return std::unique_ptr(new VoidField(frame)); + case 'x': return std::unique_ptr(new LongString(frame)); default: return nullptr; } }