projects
/
platform
/
core
/
uifw
/
libds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
80b13df
)
clients: Silence wstringop-truncation warning
52/280852/1
author
Seunghun Lee
<shiin.lee@samsung.com>
Tue, 6 Sep 2022 01:18:42 +0000
(10:18 +0900)
committer
Tizen Window System
<tizen.windowsystem@gmail.com>
Tue, 6 Sep 2022 01:57:03 +0000
(10:57 +0900)
Change-Id: Ia90870b6b2b21832f7f440cd141c368a314a86b3
clients/simple-shm-shell.c
patch
|
blob
|
history
diff --git
a/clients/simple-shm-shell.c
b/clients/simple-shm-shell.c
index
e0bdcb4
..
cbcdf97
100644
(file)
--- a/
clients/simple-shm-shell.c
+++ b/
clients/simple-shm-shell.c
@@
-100,8
+100,14
@@
_create_anonymous_file (off_t size)
return -1;
}
+ if (strlen(path) + strlen(template) > (PATH_MAX - 1)) {
+ errno = ENAMETOOLONG;
+ return -1;
+ }
+
strncpy(name, path, PATH_MAX);
- strncat(name, template, PATH_MAX);
+ name[PATH_MAX - 1] = '\0';
+ strncat(name, template, strlen(template));
fd = mkstemp(name);
if (fd < 0)