I am an Indonesian living in Germany. I will be traveling to Indonesia via Dubai and Kuala Lumpur. From Kuala Lumpur I will take a different airline. I just noticed that some countries ask for a 6 months passport validity to be able to enter the country. Does it also affect people who just stay a couple of hours for airport transfer? My passport expires in 4 months. Would it be a trouble if I don't renew it before traveling?
Since Emirates and Air Asia uses separate terminals at KLIA, you will be required to pass through Malaysian Immigration, and Timatic states:
Passport required. - Passport and/or passport replacing travel documents must be valid at least six months on date of arrival.
So yes, I would recommend you renew your passport first if at all possible.
That said, since you have an immediate onward connection you might be able to argue a) Emirates into them into letting you on board (this would usually entail signing a disclaimer where you agree to all responsibility if you're not allowed in) and b) Malaysia into letting you into the country. But why risk it?