All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] examples/vhost: fix the use of strnlen()
@ 2017-04-16 11:39 jiangg
  2017-05-05 12:11 ` Thomas Monjalon
  0 siblings, 1 reply; 4+ messages in thread
From: jiangg @ 2017-04-16 11:39 UTC (permalink / raw)
  To: dev; +Cc: jiangg

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(-)

diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index aa88733..e07f866 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -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));
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] examples/vhost: fix the use of strnlen()
  2017-04-16 11:39 [PATCH] examples/vhost: fix the use of strnlen() jiangg
@ 2017-05-05 12:11 ` Thomas Monjalon
  2017-05-05 13:59   ` Gang Jiang
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Monjalon @ 2017-05-05 12:11 UTC (permalink / raw)
  To: jiangg; +Cc: dev

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] examples/vhost: fix the use of strnlen()
  2017-05-05 12:11 ` Thomas Monjalon
@ 2017-05-05 13:59   ` Gang Jiang
  2017-05-10 17:06     ` Thomas Monjalon
  0 siblings, 1 reply; 4+ messages in thread
From: Gang Jiang @ 2017-05-05 13:59 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] examples/vhost: fix the use of strnlen()
  2017-05-05 13:59   ` Gang Jiang
@ 2017-05-10 17:06     ` Thomas Monjalon
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2017-05-10 17:06 UTC (permalink / raw)
  To: Gang Jiang; +Cc: dev

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-05-10 17:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-16 11:39 [PATCH] examples/vhost: fix the use of strnlen() jiangg
2017-05-05 12:11 ` Thomas Monjalon
2017-05-05 13:59   ` Gang Jiang
2017-05-10 17:06     ` Thomas Monjalon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.