Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bcc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
bcc
Commits
5a7882e3
Commit
5a7882e3
authored
May 26, 2017
by
Christian Resell
Committed by
Brenden Blanco
May 30, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcc_procutils_which: return if snprintf fails or would overflow
parent
c6c9f0a3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
src/cc/bcc_proc.c
src/cc/bcc_proc.c
+4
-2
No files found.
src/cc/bcc_proc.c
View file @
5a7882e3
...
...
@@ -46,8 +46,10 @@ char *bcc_procutils_which(const char *binpath) {
const
size_t
path_len
=
next
-
PATH
;
if
(
path_len
)
{
snprintf
(
buffer
,
sizeof
(
buffer
),
"%.*s/%s"
,
int
ret
=
snprintf
(
buffer
,
sizeof
(
buffer
),
"%.*s/%s"
,
(
int
)
path_len
,
PATH
,
binpath
);
if
(
ret
<
0
||
ret
>=
sizeof
(
buffer
))
return
0
;
if
(
bcc_elf_is_exe
(
buffer
))
return
strdup
(
buffer
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment