[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/3] add check for whole message size
From: |
Samuel Thibault |
Subject: |
Re: [PATCH 2/3] add check for whole message size |
Date: |
Sat, 27 Aug 2022 23:53:12 +0200 |
User-agent: |
NeoMutt/20170609 (1.8.3) |
Luca Dariz, le mar. 28 juin 2022 11:49:26 +0200, a ecrit:
> * user.c: ensure fixed-length messages have the correct size. In
> addition to the single-fields check, this also include padding.
>
> Signed-off-by: Luca Dariz <luca@orpolo.org>
Applied, thanks!
> ---
> user.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/user.c b/user.c
> index 9aff07c..9a84fe4 100644
> --- a/user.c
> +++ b/user.c
> @@ -275,7 +275,10 @@ WriteMsgSend(FILE *file, const routine_t *rt)
> char SendSize[24];
>
> if (rt->rtNumRequestVar == 0)
> + {
> sprintf(SendSize, "%d", rt->rtRequestSize);
> + fprintf(file, "\t_Static_assert(sizeof(Request) == %s, \"Request
> expected to be %s bytes\");\n", SendSize, SendSize);
> + }
> else
> strcpy(SendSize, "msgh_size");
>
> @@ -339,8 +342,10 @@ WriteMsgRPC(FILE *file, const routine_t *rt)
> char SendSize[24];
>
> if (rt->rtNumRequestVar == 0)
> + {
> sprintf(SendSize, "%d", rt->rtRequestSize);
> - else
> + fprintf(file, "\t_Static_assert(sizeof(Request) == %s, \"Request
> expected to be %s bytes\");\n", SendSize, SendSize);
> + } else
> strcpy(SendSize, "msgh_size");
>
> if (IsKernelUser)
> --
> 2.30.2
>
>
--
Samuel
---
Pour une évaluation indépendante, transparente et rigoureuse !
Je soutiens la Commission d'Évaluation de l'Inria.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [PATCH 2/3] add check for whole message size,
Samuel Thibault <=