• Michael Paquier's avatar
    Fix memory overrun when querying pg_stat_slru · 5f81a480
    Michael Paquier authored
    pg_stat_get_slru() in pgstatfuncs.c would point to one element after the
    end of the array PgStat_SLRUStats when finishing to scan its entries.
    This had no direct consequences as no data from the extra memory area
    was read, but static analyzers would rightfully complain here.  So let's
    be clean.
    
    While on it, this adds one regression test in the area reserved for
    system views.
    
    Reported-by: Alexander Kozhemyakin, via AddressSanitizer
    Author: Kyotaro Horiguchi
    Discussion: https://postgr.es/m/17280-37da556e86032070@postgresql.org
    Backpatch-through: 13
    5f81a480
sysviews.sql 2.67 KB