1
0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2024-06-17 04:33:57 +02:00
openwrt/package
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
..
base-files OpenWrt v18.06.8: revert to branch defaults 2020-02-27 22:32:58 +01:00
boot uboot-envtools: ar71xx: add ZyXEL NBG6616 uboot env support 2020-08-11 01:18:04 +02:00
devel strace: Update to 4.22 2018-12-18 17:22:08 +01:00
firmware ath10k: update QCA4019 firmware 2018-12-27 16:38:13 +01:00
kernel mac80211: Fix potential endless loop 2020-08-31 00:09:27 +02:00
libs mbedtls: update to 2.16.7 2020-08-27 00:20:02 +02:00
network firewall: backport patch for mss clamping in both directions 2020-07-26 22:34:49 +08:00
system ca-certificates: update to version 20200601 2020-06-10 00:31:21 +02:00
utils lua: lnum: fix strtoul based number parsing 2020-09-28 00:37:50 +02:00
Makefile packages: apply usign padding workarounds to package indexes if needed 2019-08-07 07:23:51 +02:00