| b38854bd | 09-Nov-2018 |
Bryan O'Donoghue <bryan.odonoghue@linaro.org> |
libutils: Import strtoul from newlib
This patch imports strtoul from newlib which the latest version of libfdt depends on.
Some modification of the original source is required to do this, specifica
libutils: Import strtoul from newlib
This patch imports strtoul from newlib which the latest version of libfdt depends on.
Some modification of the original source is required to do this, specifically:
This is an import of the newlib 1.19.0 version of strtoul dropping
- Headers and prototypes for re-entrancy
- Any reliance on errno
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 9fdd6c3c | 10-Nov-2018 |
Bryan O'Donoghue <bryan.odonoghue@linaro.org> |
libutils: isoc: implement isalpha(), isspace() and isupper()
This patch implements isalpha(), isspace() and isupper() which are dependencies for a subsequent patch which brings in strtoul from newli
libutils: isoc: implement isalpha(), isspace() and isupper()
This patch implements isalpha(), isspace() and isupper() which are dependencies for a subsequent patch which brings in strtoul from newlib.
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 9668cb1e | 07-May-2018 |
Jens Wiklander <jens.wiklander@linaro.org> |
stdint.h: include limits.h
The define SIZE_MAX uses ULONG_MAX, which is provided in limits.h.
Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.o
stdint.h: include limits.h
The define SIZE_MAX uses ULONG_MAX, which is provided in limits.h.
Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 5b01430c | 07-May-2018 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutils: import strcpy() and strncpy()
Imports strcpy() and strncpy() from newlib with license added
Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@
libutils: import strcpy() and strncpy()
Imports strcpy() and strncpy() from newlib with license added
Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 2b38f7fd | 04-May-2018 |
Jerome Forissier <jerome.forissier@linaro.org> |
libutils: bget_malloc.c: fix overflow tests
The overflow tests in raw_calloc(), raw_realloc() and raw_malloc() are wrong. They don't work as expected when hdr_size and ftr_size are both zero. The bu
libutils: bget_malloc.c: fix overflow tests
The overflow tests in raw_calloc(), raw_realloc() and raw_malloc() are wrong. They don't work as expected when hdr_size and ftr_size are both zero. The bug is exposed by commit 96c1d8c56cde ("ta: TEE_Malloc() and friend: skips layers") which causes xtest 8033 to fail because TEE_Malloc(0, TEE_MALLOC_FILL_ZERO) now returns NULL.
In addition, the allocation functions in bget.c (bget(), bgetz() and bgetr()) take a parameter of type bufsize for the allocation size. This happens to be a (signed) long. On the other hand, raw_malloc(), raw_calloc() and raw_realloc() take a size_t parameter which is unsigned long. Therefore, large size values are incorrectly interpreted as being negative by the bget code, which then asserts. When run in the context of a TA, this causes a TA panic instead of a TEE_ERROR_OUT_OF_MEMORY error. This bug is also exposed by commit 96c1d8c56cde ("ta: TEE_Malloc() and friend: skips layers") and makes xtest 8034 and 8042 fail. 8034 is TEE_Malloc(0xFFFFFFFE, TEE_MALLOC_FILL_ZERO) while 8042 is TEE_Realloc(ptr, 0xFFFFFFFE).
Rework the raw_calloc(), raw_realloc() and raw_malloc() functions to use the MUL_OVERFLOW() and ADD_OVERFLOW() macros instead, operating on the proper types.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Tested-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| ba6d8df9 | 24-May-2017 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutils: sparse fix: DETECTNULL() macro
Fixes the DETECTNULL() macro used in certain functions imported from newlib.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Jens Wik
libutils: sparse fix: DETECTNULL() macro
Fixes the DETECTNULL() macro used in certain functions imported from newlib.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (Juno) Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|