projects
/
platform
/
core
/
ml
/
nntrainer.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
258967d
)
[Application] handle getcwd return null pointer
author
hyeonseok lee
<hs89.lee@samsung.com>
Thu, 14 Sep 2023 08:17:49 +0000
(17:17 +0900)
committer
Jijoong Moon
<jijoong.moon@samsung.com>
Mon, 18 Sep 2023 07:17:44 +0000
(16:17 +0900)
- Handle when getcwd return NULL to prevent dereference null pointer
Signed-off-by: hyeonseok lee <hs89.lee@samsung.com>
Applications/SimpleShot/task_runner.cpp
patch
|
blob
|
history
diff --git
a/Applications/SimpleShot/task_runner.cpp
b/Applications/SimpleShot/task_runner.cpp
index
f58ba7c
..
d2552f4
100644
(file)
--- a/
Applications/SimpleShot/task_runner.cpp
+++ b/
Applications/SimpleShot/task_runner.cpp
@@
-104,7
+104,9
@@
const std::string getcwd_() {
const size_t bufsize = 4096;
char buffer[bufsize];
- return getcwd(buffer, bufsize);
+ char *cwd = getcwd(buffer, bufsize);
+ std::string ret = (cwd == NULL) ? "" : std::string(cwd);
+ return ret;
}
} // namespace