Do you have an app that provides for hand drawn pictures on your iPhone? Do you use MMS?
There are no viruses in iOS4, but 4.0 and 4.0.1 have a "PDF exploit" that theoretically make it vulnerable to malware. (Do you understand the difference between malware and viruses?) So far, the only example of this is a jailbreaking technique. The exploit was patched with 4.0.2 (and 4.1)
OTOH, if your phone is jailbroken, it not only has the PDF hole, but is vulnerable to other attacks, and who knows what's in your phone.