summaryrefslogtreecommitdiff
path: root/src/vwm.h
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@gnugeneration.com>2016-12-18 06:04:34 -0800
committerVito Caputo <vcaputo@gnugeneration.com>2016-12-18 06:15:00 -0800
commitc0c491486e6dc6112ffaa2eefacd0a324219b475 (patch)
tree1ab008af0e019e024076b2696d1e0682d5bf67be /src/vwm.h
parentf92c2b443b380ddd17e5d9c9ac9a55e49cde444f (diff)
overlay: fix bug with extraordinarily long argvs
This was a known bug, there's a TODO sitting right there noting it. The items array was sized very large so it never triggered and was forgotten about. Running `make tags` in the linux kernel source steps on it though, because it constructs a massive argv. This just adds a bounds check so no crash occurs in argv2xtext(). I don't see the point of allocating memory for this as the TODO's suggested, since any such argv is unlikely to fit in the overlay anyways. Also shrunk the max from 1024 to 512, which is still quite large.
Diffstat (limited to 'src/vwm.h')
-rw-r--r--src/vwm.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/vwm.h b/src/vwm.h
index 8bc0f7a..b7a975c 100644
--- a/src/vwm.h
+++ b/src/vwm.h
@@ -39,6 +39,7 @@
#define MIN(_a, _b) ((_a) < (_b) ? (_a) : (_b))
#define MAX(_a, _b) ((_a) > (_b) ? (_a) : (_b))
+#define NELEMS(_a) (sizeof(_a) / sizeof(_a[0]))
typedef struct _vwm_window_t vwm_window_t;
typedef struct _vwm_desktop_t vwm_desktop_t;
© All Rights Reserved