It may be what is called a Fernco fitting which is used to join sections of pipe which could have been repaired. Rather than cementing the parts together they are used. If done correctly there is nothing wrong with it. They are commonly used in plumbing.
Link:
Fernco