• Andres Freund's avatar
    waldump: fix use-after-free in search_directory(). · 6839aa7a
    Andres Freund authored
    After closedir() dirent->d_name is not valid anymore. As there alerady are a
    few places relying on the limited lifetime of pg_waldump, do so here as well,
    and just pg_strdup() the string.
    
    The bug was introduced in fc49e24f.
    
    Found by UBSan, run locally.
    
    Backpatch: 11-, like fc49e24f itself.
    6839aa7a
pg_waldump.c 28.5 KB