update credits
[LibreOffice.git] / external / fontconfig / ubsan.patch
blob91586b09348098761311838da3ef49fc0f825a3f
1 --- src/fcdir.c
2 +++ src/fcdir.c
3 @@ -265,7 +265,7 @@
4 /*
5 * Sort files to make things prettier
6 */
7 - qsort(files->strs, files->num, sizeof(FcChar8 *), cmpstringp);
8 + if (files->num != 0) qsort(files->strs, files->num, sizeof(FcChar8 *), cmpstringp);
11 * Scan file files to build font patterns
12 --- src/fcserialize.c
13 +++ src/fcserialize.c
14 @@ -163,7 +163,7 @@
15 size_t old_used = serialize->buckets_used;
16 size_t old_count = serialize->buckets_count;
17 FcSerializeBucket *old_buckets = serialize->buckets;
18 - FcSerializeBucket *old_buckets_end = old_buckets + old_count;
19 + FcSerializeBucket *old_buckets_end = old_count == 0 ? old_buckets : old_buckets + old_count;
21 FcSerializeBucket *new_buckets = malloc (new_count * sizeof (*old_buckets));
22 if (!new_buckets)