  Let $(R,m,k)$ be an excellent local ring of equal characteristic. Let $j$ be
a positive integer such that $H_m^i(R)$ has finite length for every $0\leq i
<j$. We prove that if $R$ is $F$-injective in characteristic $p>0$ or Du Bois
in characteristic $0$, then the truncated dualizing complex
$\tau_{>-j}\omega_R^\bullet$ is quasi-isomorphic to a complex of $k$-vector
spaces. As a consequence, $F$-injective or Du Bois singularities with isolated
non-Cohen-Macaulay locus are Buchsbaum. Moreover, when $R$ has $F$-rational or
rational singularities on the punctured spectrum, we obtain stronger results.
