I concur with most of what has been said about warlocks. They're a fun, well-balanced class with a distinctive niche, which is more than can be said for most non-core base classes. If they're overpowered at any point, it would have to be at level 1, when they're the only ones with touch attacks and Shatter at will is really useful, but that's it. In fact, at higher levels they fall increasingly behind, unless you have a great amount of consumable magic stuff. (Staffs, etc.) Virtually other classes have some way to bring the hurt hard when they really need to, but the closest the Warlock gets is Quicken Spell-like ability.
On the other hand, I really don't understand why people say warlocks make bad NPCs. They rock! As solo villains they're distinctive and versatile, (heck, Flee the Scene was made for recurring villains) while being far less headache to run than a "real" caster. And because of their steady damage output, they run no real risk of randomly killing a PC. And as mooks they're one of the few classes that can always do *something*, even in fights where they're completely outclassed. Pile on the Eldritch Blasts, Shatters and Darkness.
As for not living up to their CR, it's true that I wouldn't run a solo warlock against an equal-leveled party, but the thing about CR is that it's descriptive. If a monster (or, particularly, an NPC) isn't living up to its listed CR, the CR is wrong and you can just lower it! Use MM1 monsters' stats for benchmarks.