]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
util: specify the maximum-size element when initialize union
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 11 Nov 2018 15:35:57 +0000 (00:35 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 11 Nov 2018 15:36:01 +0000 (00:36 +0900)
Fixes oss-fuzz#11344.

src/basic/in-addr-util.h

index 2dafa3c0842b03b57f6269b8517ed4aefeaf311f..2f64c31f96b1ccb7c92452c70ecbbf21759d03e0 100644 (file)
@@ -65,7 +65,9 @@ static inline size_t FAMILY_ADDRESS_SIZE(int family) {
         return family == AF_INET6 ? 16 : 4;
 }
 
-#define IN_ADDR_NULL ((union in_addr_union) {})
+/* Workaround for clang, explicitly specify the maximum-size element here.
+ * See also oss-fuzz#11344. */
+#define IN_ADDR_NULL ((union in_addr_union) { .in6 = {} })
 
 void in_addr_data_hash_func(const void *p, struct siphash *state);
 int in_addr_data_compare_func(const void *a, const void *b);