src/fcserialize.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit dfa671ba888ea417f847b846fec0b5bfd42f1a01 Merge: a062ecb ad58277 Author: Akira TAGOH <akira@xxxxxxxxx> Date: Tue Nov 5 06:19:59 2024 +0000 Merge branch 'fix-fcserialize-nullpointer-usage' into 'main' Fix FcSerialize undefined behavior with null pointer usage See merge request fontconfig/fontconfig!339 commit ad58277b71415b714009bee33f04e8c18c7ab44d Author: Andrey Prokopyuk <andrey.prokopyuk@xxxxxxxxx> Date: Fri Nov 1 14:02:41 2024 +0300 Fix FcSerialize null pointer usage diff --git a/src/fcserialize.c b/src/fcserialize.c index 2388dcd..18c9693 100644 --- a/src/fcserialize.c +++ b/src/fcserialize.c @@ -163,7 +163,7 @@ FcSerializeResize (FcSerialize *serialize, size_t new_count) size_t old_used = serialize->buckets_used; size_t old_count = serialize->buckets_count; FcSerializeBucket *old_buckets = serialize->buckets; - FcSerializeBucket *old_buckets_end = old_buckets + old_count; + FcSerializeBucket *old_buckets_end = old_buckets ? old_buckets + old_count : NULL; FcSerializeBucket *new_buckets = malloc (new_count * sizeof (*old_buckets)); if (!new_buckets)