summaryrefslogtreecommitdiff
path: root/lib9p/9p.generated.c
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2025-01-12 23:08:14 -0700
committerLuke T. Shumaker <lukeshu@lukeshu.com>2025-01-19 15:43:29 -0700
commitcd9667d6be072a9c736e49c679b55852f7b30a6c (patch)
treec99c10d4c0caea96cc5a5420532eccaa60efe976 /lib9p/9p.generated.c
parent6381e08fd03e322d7d95973ca00c5605afb67707 (diff)
lib9p: Don't nul-terminate strings, add some string utils
Diffstat (limited to 'lib9p/9p.generated.c')
-rw-r--r--lib9p/9p.generated.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib9p/9p.generated.c b/lib9p/9p.generated.c
index 29fa4a6..dca9f8b 100644
--- a/lib9p/9p.generated.c
+++ b/lib9p/9p.generated.c
@@ -382,7 +382,7 @@ LM_ALWAYS_INLINE static bool validate_s(struct _validate_ctx *ctx) {
if (validate_2(ctx))
return true;
uint16_t len = decode_u16le(&ctx->net_bytes[base_offset]);
- if (_validate_size_net(ctx, len) || _validate_size_host(ctx, ((size_t)len)+1))
+ if (_validate_size_net(ctx, len) || _validate_size_host(ctx, ((size_t)len)))
return true;
if (!is_valid_utf8_without_nul(&ctx->net_bytes[base_offset+2], len))
return lib9p_error(ctx->ctx, LINUX_EBADMSG, "message contains invalid UTF-8");
@@ -1878,8 +1878,6 @@ LM_ALWAYS_INLINE static void unmarshal_s(struct _unmarshal_ctx *ctx, struct lib9
ctx->extra += sizeof(out->utf8[0]) * out->len;
for (typeof(out->len) i = 0; i < out->len; i++)
unmarshal_1(ctx, (uint8_t *)&out->utf8[i]);
- ctx->extra++;
- out->utf8[out->len] = '\0';
}
#endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u */