selinux: fix overflow and 0 length allocations