I am in the process of buying a house that has a roof with improperly installed flashing:

[![improper flashing](https://i.stack.imgur.com/cicPI.png)](https://i.stack.imgur.com/cicPI.png)

As you can see from the image, the flashing was installed on top of the shingles instead of underneath them. Our inspector said we would probably need a new roof within a couple of years and we can't afford to have it professionally reinstalled right now anyway, so I'd like to at least seal it up until we can replace the whole roof.

My plan right now is to fill the space under the flashing with some roof sealant like this [PL S30 10 Black Polyurethane Roof and Flashing Sealant from Loctite](http://www.homedepot.com/p/Loctite-PL-S30-10-fl-oz-Black-Polyurethane-Roof-and-Flashing-Sealant-1675273/203163733).

Is this a reasonable temporary solution to waterproof it until we can have the roof properly replaced?