Al-Bukhārī said in his Sahīh (1): “They reported that the man who shaved the Prophet’s head, may Allah bless him and grant him peace, was Ma‘mar ibn ‘Abd Allāh ibn Nadla ibn ‘Awf.” End of quotation.
He said to the barber, “Begin” (2), and pointed to the right side of his head. When the barber had finished shaving that side, he distributed the hair among those nearest him. He then gestured to the barber, who shaved the left side of his head. Then he asked, “Is Abū Talha here?” and handed him the hair. This is how the account appears in Sahīh Muslim (3).
Sahīh al-Bukhārī (4) relates from Ibn Sīrīn, from Anas, that when the Messenger of Allah, may Allah bless him and grant him peace, had his head shaved, Abū Talha was the first to receive some of his hair.
This does not contradict Muslim’s report, since Abū Talha may have received a share of the hair from the right side like everyone else, while receiving all the hair from the left side. However, Muslim also related in his Sahīh (5), from Anas, who said: “When the Messenger of Allah, may Allah bless him and grant him peace, stoned the pillar, slaughtered his sacrificial animal and had his head shaved, he presented the right side of his head to the barber, who shaved it. He then summoned Abū Talha al-Ansārī and gave him the hair. Next, he presented the left side to the barber and said, ‘Shave.’ The barber shaved it, and he gave the hair to Abū Talha, saying, ‘Distribute it among the people.’” Thus, as you can see, in this report Abū Talha’s share was the hair from the right side, whereas in the first report it was the hair from the left.