[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 1/4] nbd/server: Prefer heap over stack for parsing client
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
Re: [PATCH v3 1/4] nbd/server: Prefer heap over stack for parsing client names |
Date: |
Fri, 15 Nov 2019 14:59:13 +0000 |
14.11.2019 5:46, Eric Blake wrote:
> As long as we limit NBD names to 256 bytes (the bare minimum permitted
> by the standard), stack-allocation works for parsing a name received
> from the client. But as mentioned in a comment, we eventually want to
> permit up to the 4k maximum of the NBD standard, which is too large
> for stack allocation; so switch everything in the server to use heap
> allocation. For now, there is no change in actually supported name
> length.
>
> Signed-off-by: Eric Blake <address@hidden>
with mentioned fix:
Reviewed-by: Vladimir Sementsov-Ogievskiy <address@hidden>
PS: Great, how using g_autofree simplifies reviewing! I don't need to check
that something is leaked at some return point.
--
Best regards,
Vladimir
[PATCH v3 3/4] nbd: Don't send oversize strings, Eric Blake, 2019/11/13