git.droids-corp.org
/
dpdk.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
08dd403
)
examples/vhost: fix socket path parsing
author
Gang Jiang
<jiangg@mail.ustc.edu.cn>
Sun, 16 Apr 2017 11:39:40 +0000
(19:39 +0800)
committer
Thomas Monjalon
<thomas@monjalon.net>
Wed, 10 May 2017 17:05:59 +0000
(19:05 +0200)
The return value of strnlen(s, maxlen) is never bigger than maxlen.
Fixes:
4796ad63ba1f
("examples/vhost: import userspace vhost application")
Signed-off-by: Gang Jiang <jiangg@mail.ustc.edu.cn>
examples/vhost/main.c
patch
|
blob
|
history
diff --git
a/examples/vhost/main.c
b/examples/vhost/main.c
index
aa88733
..
e07f866
100644
(file)
--- 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));