Defensive Programming for Smart Home Cybersecurity