diff --git a/src/stkutil.c b/src/stkutil.c index 3c792ff6..43c06cd2 100644 --- a/src/stkutil.c +++ b/src/stkutil.c @@ -1202,7 +1202,7 @@ static gboolean parse_dataobj_other_address( data = comprehension_tlv_iter_get_data(iter); oa->type = data[0]; - memcpy(oa->addr, data + 1, len - 1); + memcpy(&oa->addr, data + 1, len - 1); return TRUE; } diff --git a/src/stkutil.h b/src/stkutil.h index 08110484..1c05440f 100644 --- a/src/stkutil.h +++ b/src/stkutil.h @@ -562,7 +562,11 @@ struct stk_card_reader_id { * So the maximum size is 16 (for ipv6). */ struct stk_other_address { - unsigned char addr[16]; + union { + /* Network Byte Order */ + unsigned int ipv4; + unsigned char ipv6[16]; + } addr; unsigned char type; };