s4/auth/tests: Fix kerberos test string size
authorAlexander Bokovoy <ab@samba.org>
Wed, 3 Oct 2018 19:48:00 +0000 (22:48 +0300)
committerVolker Lendecke <vl@samba.org>
Fri, 5 Oct 2018 11:08:25 +0000 (13:08 +0200)
>>> len("user0@samba.example.com")
23

But the string definition does not take a final '\0' into account.
As per Volker's suggestion, use compiler's support to allocate
the string properly.

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
source4/auth/tests/kerberos.c

index 703c8067908ebc21c2ce501e80a44c71c8cd5707..fcc8ac45f7ec0763b73a665972706912a9593366 100644 (file)
@@ -25,8 +25,8 @@ static void internal_obsolete_keytab_test(int num_principals, int num_kvnos,
        krb5_error_code code;
 
        int i,j;
-       char princ_name[6] = "user0";
-       char expect_princ_name[23] = "user0@samba.example.com";
+       char princ_name[] = "user0";
+       char expect_princ_name[] = "user0@samba.example.com";
        bool found_previous;
        const char *error_str;