]> git.lizzy.rs Git - bspwm.git/commitdiff
Enforce strict mode of jsmn.
authorTobias Stoeckmann <tobias@stoeckmann.org>
Fri, 12 Jul 2019 18:40:39 +0000 (20:40 +0200)
committerTobias Stoeckmann <tobias@stoeckmann.org>
Fri, 12 Jul 2019 18:40:39 +0000 (20:40 +0200)
If no strict mode of jsmn is enforced, then the correct amount of
json elements would have to be checked to avoid segmentation faults
on malformed state files:

$ echo '{ "focusedMonitorId" }' > malformed-state
$ bspwm -s malformed-state
Segmentation fault
$ _

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Makefile

index 23aea6e3ec535ee36f7ebc526ebe68cddaba60b5..6983939100dd2ac3205a84f083b3b28cb6b4d3cf 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@ VERCMD  ?= git describe 2> /dev/null
 VERSION := $(shell $(VERCMD) || cat VERSION)
 
 CPPFLAGS += -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION)\"
-CFLAGS   += -std=c99 -pedantic -Wall -Wextra
+CFLAGS   += -std=c99 -pedantic -Wall -Wextra -DJSMN_STRICT
 LDFLAGS  ?=
 LDLIBS    = $(LDFLAGS) -lm -lxcb -lxcb-util -lxcb-keysyms -lxcb-icccm -lxcb-ewmh -lxcb-randr -lxcb-xinerama -lxcb-shape