Ticket #4103: mc-4103-cid-coord_cache.c-fix-wrong-sizeof-argument.patch

File mc-4103-cid-coord_cache.c-fix-wrong-sizeof-argument.patch, 956 bytes (added by and, 20 months ago)
  • src/viewer/coord_cache.c

    From 9496875eb2f91a3d11cd6427bcd1efc2d9d5895f Mon Sep 17 00:00:00 2001
    From: Andreas Mohr <and@gmx.li>
    Date: Mon, 21 Dec 2020 18:23:11 +0000
    Subject: [PATCH] (coord_cache.c) fix wrong sizeof argument
    
    found by Coverity
    coverity id #32613
    
    Signed-off-by: Andreas Mohr <and@gmx.li>
    ---
     src/viewer/coord_cache.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/src/viewer/coord_cache.c b/src/viewer/coord_cache.c
    index 1ffc35551..18805dfa4 100644
    a b mcview_ccache_add_entry (coord_cache_t * cache, size_t pos, const coord_cache_en 
    9393    /* insert new entry */ 
    9494    if (pos != cache->size) 
    9595        memmove (cache->cache[pos + 1], cache->cache[pos], 
    96                  (cache->size - pos) * sizeof (*cache->cache)); 
     96                 (cache->size - pos) * sizeof (**cache->cache)); 
    9797    cache->cache[pos] = g_memdup (entry, sizeof (*entry)); 
    9898    cache->size++; 
    9999}