Technically, yes, it does void the warranty of your CPU and GPU since you're exceeding the processor's default specs. Furthermore, CPU and motherboard manufacturers often build with overclocking in mind, producing special hardware that suits overclocking. Processors and graphics cards are now much more capable of handling heat because cooling systems have improved over the years.
Overclocking is not as dangerous as it once was.