In the GNU General Public License, version 2, some limits on how you can modify the Program are listed. Point 2.b states that (emphasis mine):
You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
As there seem to be no further limitations on how the changes have to be licensed and you are not required to release your modifications:
Can I make changes to a GNU GPL v2 Program that I would not be allowed to distribute or publish provided I don't distribute and/or publish it?
For instance, adding some code coming from an Apache v2 project.