|
@@ -0,0 +1,25 @@
|
|
|
|
+Description: Fix unaligned memory access
|
|
|
|
+Author: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
|
|
|
|
+https://bitbucket.org/ripencc/bgpdump/issues/
|
|
|
|
+Last-Update: 2016-10-30
|
|
|
|
+
|
|
|
|
+ Causes FTBFS at least on sparc64
|
|
|
|
+
|
|
|
|
+--- a/bgpdump_lib.c
|
|
|
|
++++ b/bgpdump_lib.c
|
|
|
|
+@@ -1295,12 +1295,14 @@
|
|
|
|
+ space = 1;
|
|
|
|
+
|
|
|
|
+ int asn_pos = i * as->asn_len;
|
|
|
|
++ u_int32_t temp;
|
|
|
|
+ switch(as->asn_len) {
|
|
|
|
+ case ASN16_LEN:
|
|
|
|
+ asn = ntohs (*(u_int16_t *) (segment->data + asn_pos));
|
|
|
|
+ break;
|
|
|
|
+ case ASN32_LEN:
|
|
|
|
+- asn = ntohl (*(u_int32_t *) (segment->data + asn_pos));
|
|
|
|
++ memcpy (&temp, segment->data + asn_pos, sizeof (u_int32_t));
|
|
|
|
++ asn = ntohl (temp);
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ assert("invalid asn_len" && false);
|