diff options
author | Ulrich Drepper <drepper@redhat.com> | 2004-03-19 07:16:54 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2004-03-19 07:16:54 +0000 |
commit | de02bd0553bd50e457f351a1cc8d730b0e3990f9 (patch) | |
tree | ac0602b5d6a0b11eec1a61753b026bfa4a2ea4a4 /malloc/malloc.c | |
parent | 14c3586351fdf3e123b000f95a1e83314f78babb (diff) | |
download | glibc-de02bd0553bd50e457f351a1cc8d730b0e3990f9.zip glibc-de02bd0553bd50e457f351a1cc8d730b0e3990f9.tar.gz glibc-de02bd0553bd50e457f351a1cc8d730b0e3990f9.tar.bz2 |
Update.
2004-03-18 Ulrich Drepper <drepper@redhat.com>
* malloc/malloc.c (__posix_memalign): Correct alignment check.
Reported by Don Heller <dheller@cse.psu.edu>.
Diffstat (limited to 'malloc/malloc.c')
-rw-r--r-- | malloc/malloc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/malloc/malloc.c b/malloc/malloc.c index 4839262..6cac7d4 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -5418,7 +5418,9 @@ __posix_memalign (void **memptr, size_t alignment, size_t size) /* Test whether the SIZE argument is valid. It must be a power of two multiple of sizeof (void *). */ - if (alignment % sizeof (void *) != 0 || !powerof2 (alignment) != 0) + if (alignment % sizeof (void *) != 0 + || !powerof2 (alignment / sizeof (void *)) != 0 + || alignment == 0) return EINVAL; /* Call the hook here, so that caller is posix_memalign's caller |