Skip to content
Snippets Groups Projects
Commit 33c3329b authored by Andy Postnikov's avatar Andy Postnikov
Browse files

community/lexbor: upgrade to 2.3.0

parent 3d59d9c1
No related branches found
No related tags found
1 merge request!51001community/lexbor: upgrade to 2.3.0
Pipeline #178275 passed
From 5cd5c2ccfac13da467657e0ef0d3bd33f45250d9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
Date: Sun, 6 Aug 2023 00:16:48 +0200
Subject: [PATCH] Core: Fix test failure on 32-bit architectures
On 32-bit architectures, the lexbor_core_hash test can segfault. This
has been reported in 2022 in #153. The root cause of the issue is that
the hash map implementation assumes that the hash map entry type is at
least large enough to store a `lexbor_hash_entry_t` type. This is never
explicitly documented anywhere, but the following allocation illustrates
this implicit assumption:
https://github.com/lexbor/lexbor/blob/743353b511bd554daf50c9e08945ee6790333157/source/lexbor/core/hash.c#L98
The `hash->entries` members corresponds to the `struct_size` specified
during `lexbor_hash_init`. Regarding `struct_size` the following
assumption must hold for the code above to make some sense:
struct_size >= sizeof(lexbor_hash_entry_t)
For the `hash_entry_t` from `test/lexbor/core/hash.c` this assumption
does not necessarily hold as, contrary to other hash structures defined
in the source, this struct doesn't include a `lexbor_hash_entry_t`
member. This commit fixes this by adding this member.
Fixes #153
---
test/lexbor/core/hash.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/test/lexbor/core/hash.c b/test/lexbor/core/hash.c
index 583f3ea..bdd6a4e 100755
--- a/test/lexbor/core/hash.c
+++ b/test/lexbor/core/hash.c
@@ -10,6 +10,8 @@
typedef struct {
+ lexbor_hash_entry_t entry;
+
lexbor_hash_t hash;
size_t value;
}
# Contributor: Grigory Kirillov <txgk@bk.ru> # Contributor: Grigory Kirillov <txgk@bk.ru>
# Maintainer: Haelwenn (lanodan) Monnier <contact+alpine@hacktivis.me> # Maintainer: Haelwenn (lanodan) Monnier <contact+alpine@hacktivis.me>
pkgname=lexbor pkgname=lexbor
pkgver=2.2.0 pkgver=2.3.0
pkgrel=3 pkgrel=0
pkgdesc="Open source HTML Renderer library" pkgdesc="Open source HTML Renderer library"
url="http://lexbor.com" url="http://lexbor.com"
arch="all" arch="all"
license="Apache-2.0" license="Apache-2.0"
makedepends="cmake samurai" makedepends="cmake samurai"
subpackages="$pkgname-static $pkgname-dev" subpackages="$pkgname-static $pkgname-dev"
source="https://github.com/lexbor/lexbor/archive/v$pkgver/lexbor-$pkgver.tar.gz source="https://github.com/lexbor/lexbor/archive/v$pkgver/lexbor-$pkgver.tar.gz"
0001-Core-Fix-test-failure-on-32-bit-architectures.patch"
build() { build() {
cmake -B build -G Ninja \ cmake -B build -G Ninja \
...@@ -30,6 +29,5 @@ package() { ...@@ -30,6 +29,5 @@ package() {
} }
sha512sums=" sha512sums="
26bbca3b41a417cbc59ba8cf736e1611966fc2202de85aabf621b840565d835e7e5ffc1b0294defc16ec883f9fb94e802bd19ed704be35fa79b41566acc05cbc lexbor-2.2.0.tar.gz add1832f2e1927538206329703cd717fb30cb6ae2f52e1a0042961062cbcafd2e3ce4437ee2081ad7b2d51c6b63b910be06987e47c4a7007321db52b2812e515 lexbor-2.3.0.tar.gz
97022be2ecc90182d92ee0e2a172231b69c8597ab4710c3faaac75c88c4e3d5b403e5e14a5adafd6c9f1b8ab88f95b0bf59ce6af29a1d5995243b9974aca85e7 0001-Core-Fix-test-failure-on-32-bit-architectures.patch
" "
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment