[dpdk-dev] examples/vhost: fix the use of strnlen()
Checks
Commit Message
The return value of strnlen(s, maxlen) is never bigger than maxlen.
Signed-off-by: jiangg <jiangg@mail.ustc.edu.cn>
---
examples/vhost/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Hi,
16/04/2017 13:39, jiangg:
> The return value of strnlen(s, maxlen) is never bigger than maxlen.
>
> Signed-off-by: jiangg <jiangg@mail.ustc.edu.cn>
Please, could you provide your full name in SoB?
We could also add a Fixes: line.
Thanks
My name is Gang Jiang.
> -----原始邮件-----
> 发件人: "Thomas Monjalon" <thomas@monjalon.net>
> 发送时间: 2017-05-05 20:11:35 (星期五)
> 收件人: jiangg <jiangg@mail.ustc.edu.cn>
> 抄送: dev@dpdk.org
> 主题: Re: [dpdk-dev] [PATCH] examples/vhost: fix the use of strnlen()
>
> Hi,
>
> 16/04/2017 13:39, jiangg:
> > The return value of strnlen(s, maxlen) is never bigger than maxlen.
> >
> > Signed-off-by: jiangg <jiangg@mail.ustc.edu.cn>
>
> Please, could you provide your full name in SoB?
>
> We could also add a Fixes: line.
>
> Thanks
05/05/2017 15:59, Gang Jiang:
> My name is Gang Jiang.
>
> 发件人: "Thomas Monjalon" <thomas@monjalon.net>
> > 16/04/2017 13:39, jiangg:
> > > The return value of strnlen(s, maxlen) is never bigger than maxlen.
> > >
> > > Signed-off-by: jiangg <jiangg@mail.ustc.edu.cn>
> >
> > Please, could you provide your full name in SoB?
> >
> > We could also add a Fixes: line.
> >
> > Thanks
Fixes: 4796ad63ba1f ("examples/vhost: import userspace vhost application")
Applied, thanks
@@ -396,7 +396,7 @@ static int
us_vhost_parse_socket_path(const char *q_arg)
{
/* parse number string */
- if (strnlen(q_arg, PATH_MAX) > PATH_MAX)
+ if (strnlen(q_arg, PATH_MAX) == PATH_MAX)
return -1;
socket_files = realloc(socket_files, PATH_MAX * (nb_sockets + 1));