Eighteen cruise missiles that Ukraine allegedly sold to China and Iran (six and twelve respectively) is a very small change compared to the total number of those missiles that were built by the Soviet Union.
The missiles in question are long-range Kh-55 (AS-15 Kent) air-launched cruise missiles, very similar to the U.S. Tomahawk. Unlike the Tomahawk, however, only a nuclear version of these missile had existed until quite recently. Since Ukraine handed over all its nuclear warheads to Russia, the missiles (and the strategic bombers that can carry them) have been just sitting there in Ukraine collecting dust. No wonder Ukraine tried to put them to some use.
There is some uncertainty about the number of the missiles: the only public accounting tool that we have, the START treaty, never intended to count actual number of cruise missiles - they were counted only by applying somewhat complicated rules to the number of bombers. The September 1991 Memorandum of Understanding listed 13 Tu-160 and 21 Tu-95MS-16 bombers at two bases in Ukraine - Priluki and Uzin respectively (five more Tu-95MS-16s were at the conversion facility at Belaya Tserkov', but these were not counted as operationally deployed). Given that a Tu-160 can carry 12 Kh-55 ALCMs and Tu-95MS-16 - 16, Ukraine would have been assumed to have 492 missiles of this type.
By the time the START Treaty actually entered into force in December 1994, the number had changed (although all the changes must have happened in 1991) - in the December 1994 MOU Ukraine is listed as having 19 Tu-160 bombers, 20 Tu-95MS-16s and 5 Tu-95MS-6s (no bombers at Belaya Tserkov' this time). The maximum load that this fleet could carry was 578 Kh-55 cruise missiles.
But this tells us nothing about the actual number of missiles that Ukraine had on its soil at the time. The number quoted in a 2003 Kommersant report is 1068. Sounds a little bit too high, given that the bombers could carry only about half of these, but not unreasonable or unusual - the Soviet Union kept spares in large numbers. And there is no reason not to believe the Kommersant reporter, Ivan Safronov - he is very reliable.
The same report says that in 2000 Russia purchased 581 of these missiles (along with 8 Tu-160 and 3 Tu-95MS bombers; no money changed hands though - Ukraine got a $275m gas debt write-off).
This means that about 500 ALCMs were still in Ukraine in 2001, when the alleged deals with Iran and China took place. I wonder why China or Iran stopped at buying just a few.