From e4104854c3ba8ed7c7f9c26515e07bbc1f760f9e Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Wed, 20 Jun 2018 18:35:55 -0400 Subject: [PATCH] if_dl: Increase size of sdl_data from 20 to 46 bytes. FreeBSD's is presently 46 bytes. CID 1422869 warns that it can get overrun in if_attach() in copying if_xname which is IF_NAMESIZE bytes (32). This breaks ABI, but BeOS did not have sockaddr_dl, it is only a modern-GCC ABI break. Since most applications assume that sockaddr_dl is variable-length and is null-terminated, as well as not used very often, hopefully this will require relatively few rebuilds. --- headers/posix/net/if_dl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/headers/posix/net/if_dl.h b/headers/posix/net/if_dl.h index b7dc7ad99b..9c79b8bd44 100644 --- a/headers/posix/net/if_dl.h +++ b/headers/posix/net/if_dl.h @@ -1,5 +1,5 @@ /* - * Copyright 2006-2012 Haiku, Inc. All Rights Reserved. + * Copyright 2006-2018 Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. */ #ifndef _NET_IF_DL_H @@ -19,7 +19,7 @@ struct sockaddr_dl { uint8_t sdl_nlen; /* interface name length (not terminated with a null byte) */ uint8_t sdl_alen; /* link level address length */ uint8_t sdl_slen; /* link layer selector length */ - uint8_t sdl_data[20]; /* minimum work area, can be larger */ + uint8_t sdl_data[46]; /* minimum work area, can be larger */ }; /* Macro to get a pointer to the link level address */