diff options
| author | Dominique Martinet <asmadeus@codewreck.org> | 2018-06-30 09:59:44 +0900 | 
|---|---|---|
| committer | Dominique Martinet <asmadeus@codewreck.org> | 2018-06-30 11:21:22 +0900 | 
| commit | f0d455f088510bf8a79aaccb2c67fc2a926b5b1a (patch) | |
| tree | fb6dfffeb69e2330d6bd63b58930cbf6ad06f7b0 /backend/drm/drm.c | |
| parent | 63eb720871004219826f16e0a79a0014ac5516e4 (diff) | |
| download | wlroots-f0d455f088510bf8a79aaccb2c67fc2a926b5b1a.tar.xz | |
drm backend: overflow fixes
These operations are done in 32-bit arithmetics before being casted to 64-bit,
thus can overflow before the cast.
Casting early fixes the issue.
Found through static analysis
Diffstat (limited to 'backend/drm/drm.c')
| -rw-r--r-- | backend/drm/drm.c | 2 | 
1 files changed, 1 insertions, 1 deletions
| diff --git a/backend/drm/drm.c b/backend/drm/drm.c index c5db480e..f4a971a2 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -973,7 +973,7 @@ int handle_drm_event(int fd, uint32_t mask, void *data) {  }  void restore_drm_outputs(struct wlr_drm_backend *drm) { -	uint64_t to_close = (1 << wl_list_length(&drm->outputs)) - 1; +	uint64_t to_close = (1L << wl_list_length(&drm->outputs)) - 1;  	struct wlr_drm_connector *conn;  	wl_list_for_each(conn, &drm->outputs, link) { | 
