In the old dynastic China, this was a risky move because if you wage massive war against external enemies, you don't have enough troops to guard imperial throne. When the war faltered, it would give easy opening for the internal political enemy to rise up against an emperor far away from the capital bogged down in a losing war.
With totalitarian system in place, it is easier now for the communist regime to wage such a war to avert internal crisis, because totalitarian apparatus can whip up hyper-nationalism and non-stop fear of state security. Communist institutions of propaganda and secret police come in handy.
If the current regime falls rather anticlimactically out of incompetence or total corruption, the hard-line regime could succeed it and pursue aggressive military expansion.
However, I doubt that their military adventure would secure any permanent gains. In the end, there would be internal break-up and real change will be set in motion. It won't be pretty, though.
this was a risky move because if you wage massive war against external enemies when you have internal political crisis