projects
/
platform
/
core
/
system
/
crash-worker.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e293ed8
)
Fix: Another instance of indexing array with negative index
43/190543/1
author
Karol Lewandowski
<k.lewandowsk@samsung.com>
Wed, 3 Oct 2018 13:43:16 +0000
(15:43 +0200)
committer
Karol Lewandowski
<k.lewandowsk@samsung.com>
Wed, 3 Oct 2018 13:45:32 +0000
(15:45 +0200)
Issue reported by Coverity.
Change-Id: Ida7f3106d650f48d5fff7e976f1bbc0df0fdc308
src/shared/util.c
patch
|
blob
|
history
diff --git
a/src/shared/util.c
b/src/shared/util.c
index
e6a2cff
..
b83dbaa
100644
(file)
--- a/
src/shared/util.c
+++ b/
src/shared/util.c
@@
-768,12
+768,12
@@
char* get_exe_path(pid_t pid)
"/proc/%d/exe", pid);
ssize_t ret = readlink(exe_link, buffer, sizeof(buffer) - 1);
- buffer[ret] = '\0';
if (ret <= 0) {
_E("Failed to read link %s: %m", exe_link);
return NULL;
}
+ buffer[ret] = '\0';
if (access(buffer, F_OK) == -1) {
_E("Invalid path %s", buffer);