fontconfig: Branch 'main' - 3 commits

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 src/fccache.c |    3 +++
 src/fccfg.c   |    2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 4b3021521c4688eed1ba73381dac3f744dbc9100
Merge: 90993ff b892c21
Author: Akira TAGOH <akira@xxxxxxxxx>
Date:   Wed Nov 13 02:38:07 2024 +0000

    Merge branch 'lock-sanitization' into 'main'
    
    Ensure lock/unlock symmetry
    
    See merge request fontconfig/fontconfig!341

commit b892c2196d0d9e74df61620e79ad8e846b01637d
Author: Kenny Levinsen <kl@xxxxxx>
Date:   Tue Nov 12 10:43:56 2024 +0100

    Ensure config is locked during retry in FcConfigReference
    
    The retry loop expects to be able to unlock the config. During
    FcConfigReference, If FcInitLoadConfigAndFonts failed, the function
    would loop back to retry without re-locking the config, leading to an
    immediate double-unlock.
    
    Lock the config immdiately after FcInitLoadConfigAndFonts to avoid
    double unlock.

diff --git a/src/fccfg.c b/src/fccfg.c
index d1f5856..c951020 100644
--- a/src/fccfg.c
+++ b/src/fccfg.c
@@ -336,9 +336,9 @@ FcConfigReference (FcConfig *config)
 	    unlock_config ();
 
 	    config = FcInitLoadConfigAndFonts ();
+	    lock_config ();
 	    if (!config)
 		goto retry;
-	    lock_config ();
 	    if (!fc_atomic_ptr_cmpexch (&_fcConfig, NULL, config))
 	    {
 		FcConfigDestroy (config);
commit ec20037908963870e27572fadef766cc8a6d9818
Author: Kenny Levinsen <kl@xxxxxx>
Date:   Tue Nov 12 10:39:49 2024 +0100

    Unlock on allocation failure in FcCacheInsert
    
    If an allocation error occurred during FcCacheInsert, the function would
    return without unlocking the cache lock, deadlocking all future
    interactions with the cache.
    
    Unlock the cache on allocation failure.

diff --git a/src/fccache.c b/src/fccache.c
index e74dada..f5c41ae 100644
--- a/src/fccache.c
+++ b/src/fccache.c
@@ -586,7 +586,10 @@ FcCacheInsert (FcCache *cache, struct stat *cache_stat)
 
     s = malloc (sizeof (FcCacheSkip) + (level - 1) * sizeof (FcCacheSkip *));
     if (!s)
+    {
+	unlock_cache ();
 	return FcFalse;
+    }
 
     s->cache = cache;
     s->size = cache->size;



[Index of Archives]     [Fedora Fonts]     [Fedora Users]     [Fedora Cloud]     [Kernel]     [Fedora Packaging]     [Fedora Desktop]     [PAM]     [Gimp Graphics Editor]     [Yosemite News]

  Powered by Linux