diff options
author | Andreas Jaeger <aj@suse.de> | 2013-05-10 20:28:40 +0200 |
---|---|---|
committer | Andreas Jaeger <aj@suse.de> | 2013-05-10 20:28:40 +0200 |
commit | 8a67a4b3435d8471523d3ae4f7cb46cf9b8d72d9 (patch) | |
tree | ef04f3f9462ec0ee800c05bca3ec18ca04100b2e /sysdeps/unix/sysv/linux/bits | |
parent | 51df539d98c5906c325f73b0436f444a86818770 (diff) | |
download | glibc-8a67a4b3435d8471523d3ae4f7cb46cf9b8d72d9.tar.gz glibc-8a67a4b3435d8471523d3ae4f7cb46cf9b8d72d9.tar.xz glibc-8a67a4b3435d8471523d3ae4f7cb46cf9b8d72d9.zip |
Fix integer overflow in sysdeps/unix/sysv/linux/bits/sched.h
[BZ #15448] * sysdeps/unix/sysv/linux/bits/sched.h (__CPU_SET_S) (__CPU_CLR_S, __CPU_ISSET_S): Avoid integer overflow.
Diffstat (limited to 'sysdeps/unix/sysv/linux/bits')
-rw-r--r-- | sysdeps/unix/sysv/linux/bits/sched.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sysdeps/unix/sysv/linux/bits/sched.h b/sysdeps/unix/sysv/linux/bits/sched.h index 5e8057b62e..e42dee8e62 100644 --- a/sysdeps/unix/sysv/linux/bits/sched.h +++ b/sysdeps/unix/sysv/linux/bits/sched.h @@ -144,21 +144,21 @@ typedef struct # define __CPU_SET_S(cpu, setsize, cpusetp) \ (__extension__ \ ({ size_t __cpu = (cpu); \ - __cpu < 8 * (setsize) \ + __cpu / 8 < (setsize) \ ? (((__cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)] \ |= __CPUMASK (__cpu)) \ : 0; })) # define __CPU_CLR_S(cpu, setsize, cpusetp) \ (__extension__ \ ({ size_t __cpu = (cpu); \ - __cpu < 8 * (setsize) \ + __cpu / 8 < (setsize) \ ? (((__cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)] \ &= ~__CPUMASK (__cpu)) \ : 0; })) # define __CPU_ISSET_S(cpu, setsize, cpusetp) \ (__extension__ \ ({ size_t __cpu = (cpu); \ - __cpu < 8 * (setsize) \ + __cpu / 8 < (setsize) \ ? ((((const __cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)] \ & __CPUMASK (__cpu))) != 0 \ : 0; })) |