Code Review
/
vpp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
|
patch
| inline |
side by side
(parent:
03d0fbe
)
vppinfra: strstr_s_inline checks string unterminated wrong
31/34331/1
author
Steven Luong
<
[email protected]
>
Wed, 3 Nov 2021 23:49:04 +0000
(16:49 -0700)
committer
Steven Luong
<
[email protected]
>
Wed, 3 Nov 2021 23:50:20 +0000
(16:50 -0700)
When checking whether s2 is unterminated, it uses s1max. It should
use s2max.
Type: fix
Fixes:
b0598497afde60146fe8480331c9f96e7a79475a
Signed-off-by: Steven Luong <
[email protected]
>
Change-Id: I8a0b8ceebc2dd18402a87274add528c3d085a95a
src/vppinfra/string.h
patch
|
blob
|
history
diff --git
a/src/vppinfra/string.h
b/src/vppinfra/string.h
index
0d2c065
..
db09c50
100644
(file)
--- a/
src/vppinfra/string.h
+++ b/
src/vppinfra/string.h
@@
-1395,7
+1395,7
@@
strstr_s_inline (char *s1, rsize_t s1max, const char *s2, rsize_t s2max,
clib_c11_violation ("substring NULL");
if (s1 && s1max && (s1[clib_strnlen (s1, s1max)] != '\0'))
clib_c11_violation ("s1 unterminated");
- if (s2 && s2max && (s2[clib_strnlen (s2, s
1
max)] != '\0'))
+ if (s2 && s2max && (s2[clib_strnlen (s2, s
2
max)] != '\0'))
clib_c11_violation ("s2 unterminated");
return EINVAL;
}