blob: 37c3e63262154b71cbdd3df399193ad2346bfb07 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
https://github.com/avahi/avahi/commit/358e5a3b0122b418614e2ac0fc71f6aad1de06f8
From 358e5a3b0122b418614e2ac0fc71f6aad1de06f8 Mon Sep 17 00:00:00 2001
From: Michal Sekletar <msekleta@redhat.com>
Date: Mon, 23 Jun 2025 16:27:40 +0200
Subject: [PATCH] Make data member as big as IPv6 address
Unfortunately, recent FORTIFY_SOURCE hardening for inet_pton() can't
deal with our type independent "data[1]" union member trick.
Fixes #699
---
avahi-common/address.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/avahi-common/address.h b/avahi-common/address.h
index a14104fad..013fa975e 100644
--- a/avahi-common/address.h
+++ b/avahi-common/address.h
@@ -71,9 +71,9 @@ typedef struct AvahiAddress {
AvahiProtocol proto; /**< Address family */
union {
- AvahiIPv6Address ipv6; /**< Address when IPv6 */
- AvahiIPv4Address ipv4; /**< Address when IPv4 */
- uint8_t data[1]; /**< Type-independent data field */
+ AvahiIPv6Address ipv6; /**< Address when IPv6 */
+ AvahiIPv4Address ipv4; /**< Address when IPv4 */
+ uint8_t data[sizeof(AvahiIPv6Address)]; /**< Type-independent data field */
} data;
} AvahiAddress;
|