# HG changeset patch # User Christian Brabandt # Date 1484410504 -3600 # Node ID 98ee4f22da6e05e1c044afd6ae767942eec48d3a # Parent e90e0288851a691d308af0204cd74168b11d40dc patch 8.0.0183: ubsan warns for unaligned address commit https://github.com/vim/vim/commit/7173b47958a238bb07f80b8f26fb232b0ea69b4a Author: Bram Moolenaar Date: Sat Jan 14 17:04:38 2017 +0100 patch 8.0.0183: ubsan warns for unaligned address Problem: Ubsan warns for using a pointer that is not aligned. Solution: First copy the address. (Yegappan Lakshmanan) diff --git a/src/channel.c b/src/channel.c --- a/src/channel.c +++ b/src/channel.c @@ -710,7 +710,14 @@ channel_open( channel_free(channel); return NULL; } - memcpy((char *)&server.sin_addr, host->h_addr, host->h_length); + { + char *p; + + /* When using host->h_addr directly ubsan warns for it to not be + * aligned. First copy the pointer to aviod that. */ + memcpy(&p, &host->h_addr, sizeof(p)); + memcpy((char *)&server.sin_addr, p, host->h_length); + } /* On Mac and Solaris a zero timeout almost never works. At least wait * one millisecond. Let's do it for all systems, because we don't know why diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -765,6 +765,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 183, +/**/ 182, /**/ 181,