The time to failure seems to vary by quite a lot (perhaps depending on environmental conditions) and they were still using the flawed sensor in replacements until some time in 2015, so I wouldn't make any assumptions about a random camera without direct evidence, like the CCD ID Dan mentions. Replacing the cover glass seems to be a somewhat risky procedure and isn't always possible (see the disclaimer
here).
This is the big issue really, Leica only ever swapped the entire sensor assembly including PCB. Which means that now they're out of sensors they're out any part related to the sensor
Personally I wouldn't buy an M9 (for starters I have one already, with a 2017 sensor replacement) that needs the 3rd party repair, I'd only consider it if I needed it on an existing camera, then I'd approach the various companies offering a cover glass replacement and ask them for their guaranty and pick the one that I trusted
I'm not doubting internet rhetoric that the CCD ID tells the story, but if it were me (and again it's not) I'd contact Leica directly with the serial number of my intended purchase and enquire if its had the sensor replacement
and when - apparently they're happy to provide this information
To be fair to Leica... from what I've read about the failure, the original sensor OEM (Kodak) made a poor choice ordering the correct specification cover glass from Schott (or maybe it was Schott's mistake), then it took some years to come to light, ie have enough failures for it to be a wide enough reaching problem (remember not everyone is on the internet complaining, if you sell 1000s of units then it takes a while to get sufficient data that something is potentially wrong with all of them, especial when the part in question is supplier sourced), by this time Kodak had long since stopped making sensors and sold their sensor business. I think this was in turn sold on again (!) and the final owner of the Kodak sensor manufacturing capabilities produced the units that are corrosion free. Again... A few hundred or even thousand folks on the internet extolling the virtues of the CCD look through dewy eyes isn't enough to keep an outdated product alive (the M9 sensor was hardly cutting edge in 2009 let alone 2020!) and they duly ceased fabrication in 2020.
Which is why Leica ran out and can't supply them any longer.
I do love my M9 though... it has a charm to the colours and especially the tonality that really suits some images. I don't use it as much as I should simply because if I break it or wear it out I don't want the hassle of replacing it.
The M10 is more my daily driver now! The IQ isn't the same (although I've profiled out some of the biggest colour differences), but I like the M10 images, they have enough charm with good colour.