summaryrefslogtreecommitdiffhomepage
path: root/libs/web/src
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2013-01-26 19:57:18 +0000
committerJo-Philipp Wich <jow@openwrt.org>2013-01-26 19:57:18 +0000
commitbb6ba23b3d9c170f05d6eddfb12036e799ca326a (patch)
tree8e2d7c6b4272cb5b82efdf42125c0b6aa4b32bfc /libs/web/src
parentad3ec0d4eef6e7bf7c9c43a669fbaee50f8c4f31 (diff)
libs/web: add missing byteswap of index offset when parsing index offset of lmo files
Diffstat (limited to 'libs/web/src')
-rw-r--r--libs/web/src/template_lmo.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/web/src/template_lmo.c b/libs/web/src/template_lmo.c
index 7fcd2cda1..164999e88 100644
--- a/libs/web/src/template_lmo.c
+++ b/libs/web/src/template_lmo.c
@@ -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;