]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(__mempcpy): Protect size arg for addition when using __builtin_memcpy.
authorUlrich Drepper <drepper@redhat.com>
Tue, 29 Jan 2002 19:07:59 +0000 (19:07 +0000)
committerUlrich Drepper <drepper@redhat.com>
Tue, 29 Jan 2002 19:07:59 +0000 (19:07 +0000)
string/bits/string2.h

index 6c56c63cc12c1fe4a85cf6382b79510749f98c33..da168facc28ebe8a04fac30ea0b481e1f65c407b 100644 (file)
@@ -202,7 +202,7 @@ __STRING2_COPY_TYPE (8);
 #    define __mempcpy(dest, src, n) \
   (__extension__ (__builtin_constant_p (src) && __builtin_constant_p (n)      \
                  && __string2_1bptr_p (src) && n <= 8                        \
-                 ? __builtin_memcpy (dest, src, n) + n                       \
+                 ? __builtin_memcpy (dest, src, n) + (n)                     \
                  : __mempcpy (dest, src, n)))
 #   else
 #    define __mempcpy(dest, src, n) \