From: Arun Prakash Jana Date: Fri, 2 Mar 2018 19:38:15 +0000 (+0530) Subject: Both src and dst should be alignment checked separately X-Git-Tag: v1.8~63 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=10e84a28ed9bc1ff18518bada28a488631914678;p=nnn.git Both src and dst should be alignment checked separately The following pattern passes the current check: src - 1010 dst - 0101 mask - 1111 --- diff --git a/nnn.c b/nnn.c index 882a470e..291c1196 100644 --- a/nnn.c +++ b/nnn.c @@ -488,7 +488,7 @@ xstrlcpy(char *dest, const char *src, size_t n) * To enable -O3 ensure src and dest are 16-byte aligned * More info: http://www.felixcloutier.com/x86/MOVDQA.html */ - if ((n >= lsize) && !((ulong)src & (ulong)dest & _ALIGNMENT_MASK)) { + if ((n >= lsize) && (((ulong)src & _ALIGNMENT_MASK) == 0 && ((ulong)dest & _ALIGNMENT_MASK) == 0)) { s = (ulong *)src; d = (ulong *)dest; blocks = n >> _WSHIFT;