nuttx/libs/libc/stdlib
Peter Bee 1f5786f5ea libc/stdlib: Fix range check in strtoul(l)
The previous implementation of strtoul(l) is flawed. The range check
assumed that when overflow happens, the truncated value is smaller than
the original value. As a counter example, passing "10000000000" to
strtol will not trigger ERANGE, but return a truncated value. This patch
adds more accurate range checks.

Change-Id: I239e034e390b4974157ed6efa17110f2e74904cf
Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2020-11-12 06:01:33 -08:00
..
Kconfig libs/libc: Remove support for CONFIG_FS_WRITABLE 2020-03-22 08:24:07 -05:00
lib_abort.c drivers/usbhost/usbhost_composite.c: The cfgdesc pointer was initialized after the buffer had been advanced, so it was not pointing where it should. The totallen operations at the end of the function ended up overwriting memory belonging to the first copied interface descriptor. 2019-06-22 07:27:15 -06:00
lib_abs.c
lib_aligned_alloc.c user-space memalign() must not be called from within the OS. 2020-08-04 22:45:47 +01:00
lib_atof.c libc: Refine the inline handling 2020-07-04 11:10:29 +09:00
lib_atoi.c libc: Refine the inline handling 2020-07-04 11:10:29 +09:00
lib_atol.c libc: Refine the inline handling 2020-07-04 11:10:29 +09:00
lib_atoll.c libc: Refine the inline handling 2020-07-04 11:10:29 +09:00
lib_bsearch.c
lib_checkbase.c
lib_div.c Remove CONFIG_CAN_PASS_STRUCT 2020-04-11 21:19:47 +01:00
lib_Exit.c libc: Refine the inline handling 2020-07-04 11:10:29 +09:00
lib_itoa.c
lib_labs.c
lib_ldiv.c Remove CONFIG_CAN_PASS_STRUCT 2020-04-11 21:19:47 +01:00
lib_llabs.c
lib_lldiv.c Remove CONFIG_CAN_PASS_STRUCT 2020-04-11 21:19:47 +01:00
lib_mblen.c libc: Implement mblen, mbstowcs and wcstombs 2020-06-02 07:13:37 -06:00
lib_mbstowcs.c libc: Implement mblen, mbstowcs and wcstombs 2020-06-02 07:13:37 -06:00
lib_mbtowc.c libc: Implement wcsrtombs, wcsnrtombs and mbsnrtowcs 2020-06-02 07:13:37 -06:00
lib_mkdtemp.c libs/libc/stdlib: Implement mkdtemp(3) syscall 2020-09-19 04:16:14 -07:00
lib_mkstemp.c libs/libc/stdio: correct the prototype of mktemp(3) 2020-09-19 04:16:14 -07:00
lib_mktemp.c libs/libc/stdio: correct the prototype of mktemp(3) 2020-09-19 04:16:14 -07:00
lib_posix_memalign.c libc: Refine the inline handling 2020-07-04 11:10:29 +09:00
lib_ptsname.c
lib_ptsnamer.c
lib_qsort.c
lib_rand.c libs/libc/stdlib and include/stdlib.h: Add implementation of random() and srandom(). 2018-07-19 11:21:49 -06:00
lib_realpath.c libc: Replace all malloc/free to lib_malloc/lib_free 2020-07-29 10:14:27 +01:00
lib_srand.c libc: Move double_t typedef from sys/types.h to math.h 2020-06-29 13:37:41 +01:00
lib_stackchk.c stack check: Support Stack Smashing Protector(SSP) 2020-08-18 09:58:21 -07:00
lib_strtod.c
lib_strtof.c
lib_strtol.c Squashed commit of the following: 2019-02-14 07:03:02 -06:00
lib_strtold.c
lib_strtoll.c Squashed commit of the following: 2019-02-14 07:03:02 -06:00
lib_strtoul.c libc/stdlib: Fix range check in strtoul(l) 2020-11-12 06:01:33 -08:00
lib_strtoull.c libc/stdlib: Fix range check in strtoul(l) 2020-11-12 06:01:33 -08:00
lib_unlockpt.c
lib_wcstombs.c libc: Implement mblen, mbstowcs and wcstombs 2020-06-02 07:13:37 -06:00
lib_wctomb.c
Make.defs libs/libc/stdlib: Implement mkdtemp(3) syscall 2020-09-19 04:16:14 -07:00