99% of boats have foam in them anyway. WORST thing you could put in a boat IMO. Closed cell, can't absorb water....it's BS. People would be surprised how much water foam holds, and how many boats are affected by waterlogged foam.
However, for Wrench's suggestion as a fix it's a great one.
It sucks that something that's designed to be in the water, has water for it's worst enemy. I firmly believe that most water intrusion in boats is not caused while on the water in use, but while in storage. Most canvas type tarps do not do a good job of keeping water out, and once it's wet and covered it stays wet. When I had to store outside I always used an additional polyethylene tarp over the boat cover to do my best to keep it dry.