The buyer. If something is then wrong with the roof, depending on what option was chosen, you could then get back with the seller to (a) have the problem fixed at the seller's expense (b) Part is paid by you and part paid by seller (c) reduce the offer price by what it would cost to fix (unless the property is priced very low anyway) (d) nullify the contract.
Like I said, this depends on what option was chosen for the inspection AND if the property is bank owned. Usually when a property is bank owned, you can inspect it all you want, the bank usually won't have anything fixed.
Get with your real estate agent about these questions and an attorney if you don't have a real estate agent.
Terrence Charest, e-Pro