Two software giants, Oracle and Google, are fighting a fierce war that could upend the mobile market. Oracle, which owns Sun Microsystems, alleges that parts of Android use Sun software that Google didn’t license.

Apparently, the allegation may be legitimate, and preparing for victory, Oracle is reportedly approaching handset makers that use Android and asking them to license its software directly at significant cost.

If Oracle wins a lawsuit against Google, the implication for publishers and advertisers could be significant. After all, Apple’s iPhone franchise, as big and profitable as it is, isn’t the end-all and be-all of the mobile space. Just look at iAd. One of the reasons it isn’t getting as much love from advertisers is that there’s a huge audience of mobile users outside of the iPhone universe.

Much of that audience is using mobile devices running Android, which has played a huge role in getting smart phones and internet-enabled handsets into the hands of millions upon millions of consumers who will realistically never shell out for an iPhone.

Oracle has the potential to severely curtail the growth of this substantial audience publishers and advertisers can reach through the mobile phone. If it charges $15 to $20 to license its software, Oracle will drive up the total cost of using Android, likely making it far less popular with handset makers.

As analyst Jack Gold told Network World, “Handset makers are going to have to think long and hard about staying on Android. Because why are they on Android? Because it’s free and it’s modifiable. If you start changing the terms, handset makers have to start looking at the business proposition.

Android, of course, isn’t the only game in town, but without a free, robust mobile OS, we may see prices rise for many smart phones, which hurts the market.

The good news is that Oracle is likely posturing to some extent. If Google doesn’t settle and the company beats the search behemoth in court, it has no real incentive to kill Android. There’s no money in that, after all.

Nonetheless, Oracle’s lawsuit highlights the fact that, as strong as the mobile market is, there are cracks in some of the foundations. One lawsuit can have a huge impact on the most important stakeholders — consumers, publishers and advertisers.

None of these stakeholders can realistically change the situation, but publishers and advertisers investing heavily in mobile should recognize the risks. The mobile market may not be as mature and stable as it often appears, and mobile strategies need to take this into account.