The UN charter doesn't mention how EU countries should split up refugees among each other. It doesn't mention EU countries at all, among other things because it is an international document, and also because it was written in 1951.
The Dublin III accords, an EU internal document, stipulate that refugees shall seek asylum in the first country which they reach, and can (in principle) be deported back there by other countries. But there are safeguards against that:
Where it is impossible to transfer an applicant to the Member
State primarily designated as responsible because there are
substantial grounds for believing that there are systemic flaws
in the asylum procedure and in the reception conditions for
applicants in that Member State, resulting in a risk of inhuman
or degrading treatment within the meaning of Article 4 of the
Charter of Fundamental Rights of the European Union, the
determining Member State shall continue to examine the
criteria set out in Chapter III in order to establish whether
another Member State can be designated as responsible.
Where the transfer cannot be made pursuant to this paragraph
to any Member State designated on the basis of the criteria set
out in Chapter III or to the first Member State with which the
application was lodged, the determining Member State shall
become the Member State responsible.
http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2013:180:0031:0059:EN:PDF
The European Court of Human Rights has ruled years ago that deportations back to Greece are in violation of this clause (a relevant ruling here: (http://hudoc.echr.coe.int/eng-press?i=003-3407679-3824378#{"itemid":["003-3407679-3824378"]} - you'll have to copy-paste the link, there's too many special characters for the forum software to parse it). There's no categorical ruling yet on Hungary, but it's obvious what result such a case would have.
And then they're not allowed to travel from that country freely.<snip>
That's what the Dublin III accord stipulates, yes, but it's not in the Geneve Convention. To the contrary:
The Contracting States shall not apply to the movements of such refugees
restrictions other than those which are necessary and such restrictions
shall only be applied until their status in the country is regularized or they
obtain admission into another country.
The Contracting States shall allow
such refugees a reasonable period and all the necessary facilities to obtain
admission into another country.
http://www.unhcr.org/3b66c2aa10.html
Now it could be argued that, for the purposes of the Geneva Convention, the signatories of the Dublin III accord are one country, and preventing refugees from one signatory to another is a
necessary restriction to ensure an orderly handling of the original asylum application.