I think it was part of the initial pact negotiations, with the secret part of the pact establishing former Tzarist border. Staying at Curzon line was an accidental masterstroke by Stalin, giving the allies a fig leave to enter into alliance with him in 1941, because he totally just went in to...