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
(from parent 1:
e111bbd
)
vppinfra: fix string termination in clib_file_get_resolved_basename
12/39612/1
author
Damjan Marion
<damarion@cisco.com>
Wed, 4 Oct 2023 16:03:18 +0000
(18:03 +0200)
committer
Damjan Marion
<damarion@cisco.com>
Wed, 4 Oct 2023 16:03:25 +0000
(18:03 +0200)
Type: fix
Fixes:
40f4810
Change-Id: Idf51462c8154663de23154f17a894b7245c9fbf0
Signed-off-by: Damjan Marion <damarion@cisco.com>
src/vppinfra/unix-misc.c
patch
|
blob
|
history
diff --git
a/src/vppinfra/unix-misc.c
b/src/vppinfra/unix-misc.c
index
0c5d96c
..
2918fc3
100644
(file)
--- a/
src/vppinfra/unix-misc.c
+++ b/
src/vppinfra/unix-misc.c
@@
-148,6
+148,7
@@
clib_file_get_resolved_basename (char *fmt, ...)
r = readlink ((char *) link, buffer, sizeof (buffer) - 1);
vec_free (link);
+ buffer[r] = 0;
if (r < 1)
return 0;
@@
-159,6
+160,7
@@
clib_file_get_resolved_basename (char *fmt, ...)
while (p[0])
vec_add1 (s, p++[0]);
+ vec_add1 (s, 0);
return s;
}