-/* $OpenBSD: labelmapping.c,v 1.29 2014/10/25 03:23:49 lteo Exp $ */
+/* $OpenBSD: labelmapping.c,v 1.30 2015/01/20 18:09:12 deraadt Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
/* Optional Parameters */
while (len > 0) {
struct tlv tlv;
+ u_int32_t reqbuf, labelbuf;
if (len < sizeof(tlv)) {
session_shutdown(nbr, S_BAD_TLV_LEN, lm.msgid,
}
flags |= F_MAP_REQ_ID;
- reqid = ntohl(*(u_int32_t *)buf);
+ memcpy(&reqbuf, buf, sizeof(reqbuf));
+ reqid = ntohl(reqbuf);
break;
default:
/* ignore */
goto err;
}
- label = ntohl(*(u_int32_t *)buf);
+ memcpy(&labelbuf, buf, sizeof(labelbuf));
+ label = ntohl(labelbuf);
flags |= F_MAP_OPTLABEL;
break;
default: