projects
/
platform
/
upstream
/
wayland.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7169409
)
wayland-client: check fd is a valid value
author
jeon
<jhyuni.kang@samsung.com>
Fri, 31 Jan 2020 07:55:39 +0000
(16:55 +0900)
committer
Junkyeong Kim
<jk0430.kim@samsung.com>
Thu, 16 Feb 2023 10:10:31 +0000
(19:10 +0900)
- fix a svace issue: tainted integer
Change-Id: I1aaf98f93f06383599643d1febd8315901a7f438
src/wayland-client.c
patch
|
blob
|
history
diff --git
a/src/wayland-client.c
b/src/wayland-client.c
index
d281a65
..
dfb322f
100644
(file)
--- a/
src/wayland-client.c
+++ b/
src/wayland-client.c
@@
-44,6
+44,7
@@
#include <poll.h>
#include <pthread.h>
#include <sys/time.h>
+#include <limits.h>
#include "wayland-util.h"
#include "wayland-os.h"
@@
-1518,6
+1519,9
@@
wl_display_connect(const char *name)
return NULL;
errno = prev_errno;
+ if (fd < 0 || fd > INT_MAX - 1)
+ return NULL;
+
flags = fcntl(fd, F_GETFD);
if (flags == -1 && errno == EBADF)
return NULL;