From 8a67a4b3435d8471523d3ae4f7cb46cf9b8d72d9 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Fri, 10 May 2013 20:28:40 +0200 Subject: 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. --- sysdeps/unix/sysv/linux/bits/sched.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sysdeps/unix/sysv/linux/bits') 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; })) -- cgit v1.2.3-70-g09d2