diff options
Diffstat (limited to 'lib9p/types.c')
-rw-r--r-- | lib9p/types.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib9p/types.c b/lib9p/types.c index cb410ea..3505a4a 100644 --- a/lib9p/types.c +++ b/lib9p/types.c @@ -344,7 +344,14 @@ static ALWAYS_INLINE bool validate_s(struct _validate_ctx *ctx) { } static ALWAYS_INLINE bool validate_qt(struct _validate_ctx *ctx) { - return validate_1(ctx); + if (validate_1(ctx)) + return true; + const lib9p_qt_t mask = 0b11111110; + lib9p_qt_t val = decode_u8le(&ctx->net_bytes[ctx->net_offset-1]); + if (val & ~mask) + return lib9p_error(ctx->ctx, LINUX_EBADMSG, "unknown bits in qt bitfield: %#01"PRIx8, + val & ~mask); + return false; } static ALWAYS_INLINE bool validate_qid(struct _validate_ctx *ctx) { |