On P.217 of Quantum Field Theory by Peskin and Schroeder, it is stated that the Eq.(7.16) is infrared divergent and therefore a small photon mass $\mu$ is added to the photon propagator. The equation in question reads
$$-i\Sigma_2(p)=(ie)^2\int \frac{d^4k}{(2\pi)^4}\gamma^\mu\frac{i(k\!\!\!\big /+m_0)}{k^2-m_0^2+i\epsilon}\gamma_\mu\frac{-i}{(p-k)^2-\mu^2+i\epsilon}$$
It seems to me that the integral might be infrared divergent at $\vec{k}\rightarrow 0$, if one exchanges the momentum of the virtual eletron $k$ with that of the photon $(p-k)$, the above expression is then rewritten as
$$-i\Sigma_2(p)=(ie)^2\int \frac{d^4k}{(2\pi)^4}\gamma^\mu\frac{i(p\!\!\!\big /-k\!\!\!\big /+m_0)}{(p-k)^2-m_0^2+i\epsilon}\gamma_\mu\frac{-i}{k^2+i\epsilon}$$
First, I tried to carry out the integral in $k_0$. By choosing the contour which goes around the upper half of the complex plane, one picks the poles at $k^0=-|k|+i\epsilon$ and $k^0=k^0_{-}=p^0-\sqrt{p^{02}+|\vec{k}|^2-2\vec{p}\cdot\vec{k}}+i\epsilon$ (the latter corresponds to one of the two poles $k^0_{\pm}=p^0\pm\sqrt{p^{02}+|\vec{k}|^2-2\vec{p}\cdot\vec{k}}\mp i\epsilon$ at $k^2-2p\cdot k=0$). The resulting expression turns out to be the summation of two terms (considering that $p$ is on the mass shell)
$$-i\Sigma_2(p)\\=-ie^2\int \frac{d^3k}{(2\pi)^3}\left[\gamma^\mu\frac{i(p\!\!\!\big /-k\!\!\!\big /+m_0)}{2(p^0+|p|)|k|}\gamma_\mu\frac{-i}{-2|k|}|_{k^0=-|k|}+\gamma^\mu\frac{i(p\!\!\!\big /-k\!\!\!\big /+m_0)}{-2\sqrt{p^{02}+|\vec{k}|^2-2\vec{p}\cdot\vec{k}}}\gamma_\mu\frac{-i}{2p\cdot k}|_{k^0=k^0_-}\right]$$
So that the resulting integral of $\vec{k}$ goes like $\sim k^2dk(1/k^2+\text{no singularity})$, which does not diverge at $|k|\rightarrow 0$. What am I missing?
Also, if one evaluates the integral of $k^0$ by choosing the lower half of the complex plane (which seems also valid to me, since the module of $k^0$ becomes infinity as well and the integral at infinity approaches $2\pi k^{0}/k^{04} \rightarrow 0$), different poles will be picked but the resulting expression seems to be the same.
Edit: user110373's answer provided below explains that the divergence is infrared as it is due to the pole at $k^2=0$. I thought about it but did not understand well. It seems to me on P.199, when it discusses the infrared divergence of vertex function, the divergence disappears when $\mu$ stay finite (its origin connected to $k^2=0$ is not straightforward there). However, in the present case, the divergence is always there (for $k\rightarrow +\infty$) even when $\mu$ is finite.