mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
2002-08-07 Jakub Jelinek <jakub@redhat.com>
* malloc/malloc.c (public_cALLOc): Check ELEM_SIZE != 0 before division. * include/getopt.h: Put private decls inside [_GETOPT_H].
This commit is contained in:
@ -1,6 +1,11 @@
|
|||||||
|
2002-08-07 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
* malloc/malloc.c (public_cALLOc): Check ELEM_SIZE != 0 before
|
||||||
|
division.
|
||||||
|
|
||||||
2002-08-06 Roland McGrath <roland@redhat.com>
|
2002-08-06 Roland McGrath <roland@redhat.com>
|
||||||
|
|
||||||
* include/getopt.h: But private decls inside [_GETOPT_H].
|
* include/getopt.h: Put private decls inside [_GETOPT_H].
|
||||||
Use libc_hidden_proto for getopt_long, getopt_long_only.
|
Use libc_hidden_proto for getopt_long, getopt_long_only.
|
||||||
* posix/getopt1.c [_LIBC]: Include <getopt.h> instead of "getopt.h".
|
* posix/getopt1.c [_LIBC]: Include <getopt.h> instead of "getopt.h".
|
||||||
Add libc_hidden_def.
|
Add libc_hidden_def.
|
||||||
|
@ -3474,7 +3474,7 @@ public_cALLOc(size_t n, size_t elem_size)
|
|||||||
#define HALF_INTERNAL_SIZE_T \
|
#define HALF_INTERNAL_SIZE_T \
|
||||||
(((INTERNAL_SIZE_T) 1) << (8 * sizeof (INTERNAL_SIZE_T) / 2))
|
(((INTERNAL_SIZE_T) 1) << (8 * sizeof (INTERNAL_SIZE_T) / 2))
|
||||||
if (__builtin_expect ((n | elem_size) >= HALF_INTERNAL_SIZE_T, 0)) {
|
if (__builtin_expect ((n | elem_size) >= HALF_INTERNAL_SIZE_T, 0)) {
|
||||||
if (bytes / elem_size != n) {
|
if (elem_size != 0 && bytes / elem_size != n) {
|
||||||
MALLOC_FAILURE_ACTION;
|
MALLOC_FAILURE_ACTION;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user