Peter Jones
64e26162eb
calloc: Make sure we always have an overflow-checking calloc() available
...
This tries to make sure that everywhere in this source tree, we always have
an appropriate version of calloc() (i.e. grub_calloc(), xcalloc(), etc.)
available, and that they all safely check for overflow and return NULL when
it would occur.
Signed-off-by: Peter Jones <pjones@redhat.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2020-07-29 16:55:47 +02:00
Vladimir 'phcoder' Serbinenko
0b3b3b38bd
* grub-core/lib/posix_wrap/limits.h (SHRT_MAX): New define.
...
(INT_MAX): Likewise.
* grub-core/lib/posix_wrap/stdio.h (snprintf): New function.
* grub-core/lib/posix_wrap/stdlib.h (abs): Likewise.
* grub-core/lib/posix_wrap/string.h (memcmp): Likewise.
(strcpy): Likewise.
(strstr): Likewise.
(strchr): Likewise.
(strncpy): Likewise.
(strcat): Likewise.
(strncat): Likewise.
(strcoll): Likewise.
* include/grub/types.h (GRUB_SHRT_MAX): New define.
(GRUB_INT_MAX): Likewise.
2012-01-29 23:27:31 +01:00
Vladimir 'phcoder' Serbinenko
db7337a3d3
* grub-core/gnulib/regcomp.c (regerror): Don't use abort on
...
unexpected error.
(optimize_utf8): Likewise.
* grub-core/lib/posix_wrap/stdlib.h (abort): Removed.
2012-01-29 23:22:57 +01:00
Vladimir 'phcoder' Serbinenko
b4bf7c3b20
* grub-core/lib/posix_wrap/stdlib.h (MB_CUR_MAX): Moved from here ...
...
* grub-core/lib/posix_wrap/wchar.h (MB_CUR_MAX): ... here. Value fixed.
2012-01-14 11:48:56 +01:00
Vladimir 'phcoder' Serbinenko
02a2bf8384
Add noreturn attributes and remove unreachable code.
...
* grub-core/bus/cs5536.c (grub_cs5536_smbus_wait): Remove unreachable
code.
* grub-core/commands/halt.c (grub_cmd_halt): Remove unreachable
code. Mark as noreturn.
* grub-core/commands/minicmd.c (grub_mini_cmd_exit): Likewise.
* grub-core/commands/reboot.c (grub_cmd_reboot): Likewise.
* grub-core/disk/efi/efidisk.c (grub_efidisk_get_device_name): Remove
unreachable code.
* grub-core/kern/main.c (grub_main): Mark as noreturn.
* grub-core/kern/rescue_reader.c (grub_rescue_run): Likewise.
* grub-core/lib/posix_wrap/stdlib.h (abort): Likewise.
* grub-core/normal/menu.c (run_menu): Remove unreachable code.
* include/grub/kernel.h (grub_main): Mark as noreturn.
* include/grub/reader.h (grub_rescue_run): Likewise.
2011-12-13 15:13:51 +01:00
BVK Chaitanya
8c41176882
automake commit without merge history
2010-05-06 11:34:04 +05:30