summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus/test-bus-signature.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-03-22 02:19:49 +0100
committerLennart Poettering <lennart@poettering.net>2013-03-22 02:19:49 +0100
commit813a4f93750be40eff13f127dfef8364642a13bc (patch)
tree2bdc37d9287e089b48646224a225d7e3421ecc87 /src/libsystemd-bus/test-bus-signature.c
parentd728d708c3ccfcb34f6d7673f7855fbf0c10aeec (diff)
bus: properly verify recursion depth of signatures
Diffstat (limited to 'src/libsystemd-bus/test-bus-signature.c')
-rw-r--r--src/libsystemd-bus/test-bus-signature.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libsystemd-bus/test-bus-signature.c b/src/libsystemd-bus/test-bus-signature.c
index 4310d62e0a..5bc4310e7c 100644
--- a/src/libsystemd-bus/test-bus-signature.c
+++ b/src/libsystemd-bus/test-bus-signature.c
@@ -70,5 +70,16 @@ int main(int argc, char *argv[]) {
assert_se(signature_is_valid("sssusa(uuubbba(uu)uuuu)a{u(uuuvas)}", false));
+ assert_se(!signature_is_valid("a", false));
+ assert_se(signature_is_valid("as", false));
+ assert_se(signature_is_valid("aas", false));
+ assert_se(signature_is_valid("aaas", false));
+ assert_se(signature_is_valid("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaad", false));
+ assert_se(signature_is_valid("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaas", false));
+ assert_se(!signature_is_valid("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaau", false));
+
+ assert_se(signature_is_valid("(((((((((((((((((((((((((((((((())))))))))))))))))))))))))))))))", false));
+ assert_se(!signature_is_valid("((((((((((((((((((((((((((((((((()))))))))))))))))))))))))))))))))", false));
+
return 0;
}