1
0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2024-06-17 12:43:56 +02:00
openwrt/package/utils
Liangbin Lian bf78cd3514 lua: lnum: fix strtoul based number parsing
Lua's LNUM patch currently doesn't parse properly certain numbers as
it's visible from the following simple tests.

On x86_64 host (stock Lua 5.1.5, expected output):

 $ /usr/bin/lua -e 'print(0x80000000); print(0x80000000000); print(0x100000000)'

  2147483648
  8796093022208
  4294967296

On x86_64 host:

 $ staging_dir/hostpkg/bin/lua -e 'print(0x80000000); print(0x80000000000); print(0x100000000)'

  -2147483648
  0
  0

On x86_64 target:

 $ lua -e 'print(0x80000000); print(0x80000000000); print(0x100000000)'

  -2147483648
  0
  0

On ath79 target:

 $ lua -e 'print(0x80000000); print(0x80000000000); print(0x100000000)'

  -2147483648
  8796093022208
  4294967296

It's caused by two issues fixed in this patch, first issue is caused by
unhadled strtoul overflow and second one is caused by the cast of
unsigned to signed Lua integer when parsing from hex literal.

Run tested on:

 * Zidoo Z9S with RTD1296 CPU (aarch64_cortex-a53)
 * qemu/x86_64
 * qemu/armvirt_64
 * ath79

Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
[commit subject/message touches, fixed From to match SOB, fixed another
 unhandled case in luaO_str2i, host Lua, package bump]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 4bb9af48ca)
2020-09-28 00:37:50 +02:00
..
adb
admswconfig
bsdiff
busybox busybox: strip off ALTERNATIVES spec 2019-07-12 07:52:38 +00:00
bzip2 bzip2: Fix CVE-2019-12900 2019-09-03 12:55:00 +02:00
ct-bugcheck merge: packages: update branding in core packages 2017-12-08 19:41:18 +01:00
e2fsprogs e2fsprogs: Fix CVE-2019-5094 in libsupport 2020-01-01 20:55:17 +01:00
f2fs-tools package/utils/f2fs-tools: Update to 1.10.0 2018-04-03 23:26:45 +02:00
fbtest
fritz-tools
fuse add PKG_CPE_ID ids to package and tools 2017-11-17 02:24:35 +01:00
jboot-tools firmware: add JBOOT based devices config extractor 2018-03-18 22:22:38 +01:00
jsonfilter jsonfilter: update to latest git HEAD 2018-03-14 18:48:23 +01:00
lua lua: lnum: fix strtoul based number parsing 2020-09-28 00:37:50 +02:00
mdadm
mtd-utils mtd-utils: revert faulty upstream patch for now 2018-06-08 09:33:44 +02:00
nvram packages: nvram: fix memory leak in _nvram_free 2017-11-15 21:11:23 +01:00
osafeloader
oseama
otrx otrx: fix memory leak in otrx_create_append_zeros 2017-11-17 11:32:51 +01:00
px5g mbedtls: Update to 2.12.0 2018-08-08 22:49:59 +02:00
spidev_test
ugps ugps: update to latest git HEAD 2018-12-18 17:22:06 +01:00
usbmode treewide: replace LEDE_GIT with PROJECT_GIT 2018-01-10 21:27:32 +01:00
usbreset
usbutils usbutils: Update usb.ids to 0.315 2018-12-18 11:28:13 +01:00
util-linux flock: enable alternatives support 2018-05-07 15:50:18 +08:00
xfsprogs xfsprogs: Replace valloc with posix_memalign 2019-08-14 09:12:52 +02:00