spice-common/tests/Makefile.am
Frediano Ziglio 420a15b776 Write a small test to test possible crash
This small test prove a that current generated demarshaller code
is not safe to integer overflows leading to buffer overflows.
Actually from a quick look at the protocol it seems that client
can't cause these overflows but server can quite easily at
demonstrated by this test.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2018-05-11 17:00:26 +01:00

85 lines
2.5 KiB
Makefile

NULL =
TESTS = test_logging test_marshallers
noinst_PROGRAMS = $(TESTS)
test_logging_SOURCES = test-logging.c
test_logging_CFLAGS = \
-I$(top_srcdir) \
$(GLIB2_CFLAGS) \
$(GIO_UNIX_CFLAGS) \
$(PROTOCOL_CFLAGS) \
$(NULL)
test_logging_LDADD = \
$(top_builddir)/common/libspice-common.la \
$(GLIB2_LIBS) \
$(GIO_UNIX_LIBS) \
$(NULL)
test_marshallers_SOURCES = \
generated_test_marshallers.c \
generated_test_marshallers.h \
generated_test_demarshallers.c \
test-marshallers.c \
test-marshallers.h \
$(NULL)
test_marshallers_CFLAGS = \
-I$(top_srcdir) \
$(GLIB2_CFLAGS) \
$(PROTOCOL_CFLAGS) \
$(NULL)
test_marshallers_LDADD = \
$(top_builddir)/common/libspice-common.la \
$(GLIB2_LIBS) \
$(NULL)
# Avoid need for python(pyparsing) by end users
TEST_MARSHALLERS = \
generated_test_marshallers.c \
generated_test_marshallers.h \
generated_test_demarshallers.c \
$(NULL)
BUILT_SOURCES = $(TEST_MARSHALLERS)
MARSHALLERS_DEPS = \
$(top_srcdir)/python_modules/__init__.py \
$(top_srcdir)/python_modules/codegen.py \
$(top_srcdir)/python_modules/demarshal.py \
$(top_srcdir)/python_modules/marshal.py \
$(top_srcdir)/python_modules/ptypes.py \
$(top_srcdir)/python_modules/spice_parser.py \
$(top_srcdir)/spice_codegen.py \
$(NULL)
# Note despite being autogenerated these are not part of CLEANFILES, they are
# actually a part of EXTRA_DIST, to avoid the need for pyparser by end users
generated_test_marshallers.c: $(srcdir)/test-marshallers.proto $(MARSHALLERS_DEPS)
$(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-marshallers --server --include test-marshallers.h $< $@ >/dev/null
generated_test_marshallers.h: $(srcdir)/test-marshallers.proto $(MARSHALLERS_DEPS)
$(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-marshallers --server --include test-marshallers.h -H $< $@ >/dev/null
generated_test_demarshallers.c: $(srcdir)/test-marshallers.proto $(MARSHALLERS_DEPS)
$(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-demarshallers --client --include test-marshallers.h $< $@ >/dev/null
EXTRA_DIST = \
$(TEST_MARSHALLERS) \
test-marshallers.proto \
$(NULL)
TESTS += test_overflow
test_overflow_SOURCES = test-overflow.c
test_overflow_CFLAGS = \
-I$(top_srcdir) \
$(GLIB2_CFLAGS) \
$(SPICE_COMMON_CFLAGS) \
$(PROTOCOL_CFLAGS) \
$(NULL)
test_overflow_LDADD = \
$(top_builddir)/common/libspice-common.la \
$(top_builddir)/common/libspice-common-server.la \
$(top_builddir)/common/libspice-common-client.la \
$(NULL)
-include $(top_srcdir)/git.mk