mirror of
https://github.com/openwrt/luci.git
synced 2026-08-29 08:31:46 +04:00
libs/web: add missing byteswap of index offset when parsing index offset of lmo files
This commit is contained in:
@@ -123,8 +123,8 @@ lmo_archive_t * lmo_open(const char *file)
|
||||
if ((ar->mmap = mmap(NULL, ar->size, PROT_READ, MAP_SHARED, ar->fd, 0)) == MAP_FAILED)
|
||||
goto err;
|
||||
|
||||
idx_offset = *((const uint32_t *)
|
||||
(ar->mmap + ar->size - sizeof(uint32_t)));
|
||||
idx_offset = ntohl(*((const uint32_t *)
|
||||
(ar->mmap + ar->size - sizeof(uint32_t))));
|
||||
|
||||
if (idx_offset >= ar->size)
|
||||
goto err;
|
||||
|
||||
Reference in New Issue
Block a user