According to the San Francisco AIDS Foundation, HIV is not transmitted via saliva. Even though you mention mouth ulcers, the level of the HIV/AIDS virus that is normally contained in saliva is 10,000 times less than that found in blood, so although you may be at risk for other types of infections, HIV/AIDS is not likely solely via saliva. However, drinking someone’s cum is still considered low risk, even though semen is one of the fluids that transfers the HIV/AIDS virus. Since it had been sitting in the cup/bottle, the risk is much lower than if you had sucked the questionable person’s penis directly.
Because of the mouth sores involved, there’s a slight–though fairly low–chance that you may still be at risk, and it’s certainly best not to go around drinking unidentified fluids out of random cups, as you put yourself at risk for all kinds of orally transmissable diseases above and beyond HIV/AIDS. Get a clean glass; better safe than sorry!
As far as HIV surviving outside the body more generally, the risk is
still virtually zero. According to the About.com guide to AIDS, “In
artificially high concentrations produced in the lab, HIV drying that
occurs outside of the body reduces the number of infectious viral
particles by 99 percent in just a few hours.” The guide does warn that other diseases such as hepatitis B and C may, however, live on in bodily fluids (particularly if they have not dried), so you may want to have yourself screened for those infections as well, particularly if you haven’t had the hepatitis vaccine.
Good luck with your tests, and I hope they all come out clean!