Can I publish a source code containing potential copyright violations that someone gave me at a university (updated)?
With the caveat that I am not a lawyer, the answer is "no".

You have:


code A, which is GPL-licensed
code B, which is a derivative work of A and not GPL-licensed. 


The GPL license requires that all derivative works are also GPL-licensed. As B does not carry the GPL license, it is a copyright violation and (depending on jurisdiction) it is probably illegal for you to distribute it.

If the changes needed are small, your simplest way forward would be to take code A, and modify it yourself as needed to make code C, while keeping it GPL-licensed, and release that.

EDIT: As noted in the comments, it is possible that A had two licenses: The GPL, and another license granted specifically to the author of B which permitted them to change the names and redistribute without GPL. This seems very unlikely, but you should consider the possibility if considering accusations of any sort.