Hate to say it but if that section is corroded through, the rest isn’t far behind.
My be worth replacing as much as you can. (Include the clean outs along the way).
PVC is cheap, adding another $30 bucks now will save you from doing this again, to a different section, a few months from now.