from k5test import *

realm = K5Realm()

# CVE-2013-1416 KDC dereferences null pointer

realm.kinit(realm.user_princ, password('user'))
realm.run([kvno, '/test'], expected_code=1)
realm.run([kvno, 'test/'], expected_code=1)
realm.run([kvno, '/'], expected_code=1)
# Make sure KDC is still running.
realm.kinit(realm.user_princ, password('user'))
success('CVE-2013-1416 regression test')
