Re: [PATCH 4/4] lwip: Fix a buffer overflow and clear compiler warnings

2018-08-14 Thread Samuel Thibault
Joan Lledó, le mar. 14 août 2018 18:17:28 +0200, a ecrit: > Missatge de Samuel Thibault del dia dt., 14 > d’ag. 2018 a les 9:34: > > > - strncpy (in->dev_name, arg, DEV_NAME_LEN); > > > + strncpy (in->dev_name, arg, sizeof(in->dev_name)-1); > > > > Mmm, but if arg is longer than the

Re: [PATCH 4/4] lwip: Fix a buffer overflow and clear compiler warnings

2018-08-14 Thread Joan Lledó
Missatge de Samuel Thibault del dia dt., 14 d’ag. 2018 a les 9:34: > > - strncpy (in->dev_name, arg, DEV_NAME_LEN); > > + strncpy (in->dev_name, arg, sizeof(in->dev_name)-1); > > Mmm, but if arg is longer than the given size and doesn't contain a \0, > in->dev_name will not contain one

Re: [PATCH 4/4] lwip: Fix a buffer overflow and clear compiler warnings

2018-08-14 Thread Samuel Thibault
Joan Lledó, le sam. 11 août 2018 18:17:10 +0200, a ecrit: > GCC 8 new warning -Wstringop-truncation detected some buffer overflows. > > * lwip/options.c (parse_opt): Fix the buffer overflow. > * lwip/pfinet-ops.c (dev_ifconf): Likewise. > --- > lwip/options.c| 2 +- > lwip/pfinet-ops.c | 2

[PATCH 4/4] lwip: Fix a buffer overflow and clear compiler warnings

2018-08-11 Thread Joan Lledó
GCC 8 new warning -Wstringop-truncation detected some buffer overflows. * lwip/options.c (parse_opt): Fix the buffer overflow. * lwip/pfinet-ops.c (dev_ifconf): Likewise. --- lwip/options.c| 2 +- lwip/pfinet-ops.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH 4/4] lwip: Fix a buffer overflow and clear compiler warnings

2018-08-07 Thread Joan Lledó
--- lwip/options.c| 2 +- lwip/pfinet-ops.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lwip/options.c b/lwip/options.c index 6591ac52..d35b9f32 100644 --- a/lwip/options.c +++ b/lwip/options.c @@ -133,7 +133,7 @@ parse_opt (int opt, char *arg, struct argp_state