MQTT to IR

I am not really a C expert, but didn't just potentially overwrite some random part of memory?

Not if the payload array is large enough.