To: vim_dev@googlegroups.com Subject: Patch 8.0.0183 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.0183 Problem: Ubsan warns for using a pointer that is not aligned. Solution: First copy the address. (Yegappan Lakshmanan) Files: src/channel.c *** ../vim-8.0.0182/src/channel.c 2017-01-10 15:15:32.882134134 +0100 --- src/channel.c 2017-01-14 17:01:34.220082253 +0100 *************** *** 710,716 **** channel_free(channel); return NULL; } ! memcpy((char *)&server.sin_addr, host->h_addr, 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 --- 710,723 ---- channel_free(channel); return NULL; } ! { ! 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 *** ../vim-8.0.0182/src/version.c 2017-01-14 15:52:42.889489220 +0100 --- src/version.c 2017-01-14 16:58:58.469042689 +0100 *************** *** 766,767 **** --- 766,769 ---- { /* Add new patch number below this line */ + /**/ + 183, /**/ -- We're knights of the round table We dance whene'er we're able We do routines and chorus scenes With footwork impeccable. We dine well here in Camelot We eat ham and jam and spam a lot. "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///