Modified kernel_panic function to enforce string lengths.