How do piston engines deal with sea spray (saltwater ingestion)? From my related question, I want to know about sea spray being ingested into a piston engine during flight. Will this immediately corrode the engine unless there are special materials?

I'm asking this for piston engines, not jets or turboprops. I'm especially interested in WW2-era planes.

Obviously this is primarily about naval aircraft built for saltwater environments, but I'd like to know the protection measures so I can see if a land-based aircraft can be easily modified, or if it's going to need an entirely new engine.

Note: At very high temperatures, corrosion is much faster. I don't know the math for corrosion, but my worry is that sea spray in the engine could cause some cracks somewhere after just a few flights, unless things are made from a much higher (more expensive) grade of stainless steel or aluminum alloy.
Seaplanes operate from coastal saltwater all the time, ingesting lots of seawater, and they don't do anything special to the engines to deal with seawater ingestion.  The effort is mostly on keeping salt rinsed from the airframe and engine externally and they normally get a fresh water rinse at the end of the flying day.  Some operators may spray nicely atomized fresh water into the engine intake while running it to rinse salt from intake passages and carburetors etc, when they are doing the external bits.  

The other measure is keeping the protective coatings intact, including the paint on the engine.  You really don't want salt on an engine where paint is flaking off aluminum fins or areas of the head, because corrosion pitting results that leads to cylinder head cracks. 

So the main protection measure is, keep the salt rinsed off as much as possible with fresh water, and maintain the protective coatings. Even with all that, coastal aircraft operating daily from seawater year-round often require airframe rebuilds to deal with corrosion maybe every 10 years or so.

In any case there aren't any physical modifications you can do to an engine.