return -EPROTO;
}
/* Decode topic string */
- tmp = *((uint16_t*)(buf + idx));
+ memcpy(&tmp, (buf + idx), 2);
topic_len = ntohs(tmp);
pkt->topic.name = (char*)(buf + idx + 2);
idx += topic_len + 2;
return -EPROTO;
}
/* Decode packet ID */
- tmp = *((uint16_t*)(buf + idx));
- pkt->packet_id = ntohs(tmp);
idx += 2;
+ memcpy(&tmp, (buf + idx), 2);
+ pkt->packet_id = ntohs(tmp);
/* Get application message */
pkt->message_size = size - idx;
if (pkt->message_size != 0) {