كتاب الإمارة
33  
The Book on Government
(18)
Chapter: It is recommended for the army to swear allegiance to the ruler when intending to fight, and an account of Bay'at Ar-Ridwan beneath the tree
(18)
باب اسْتِحْبَابِ مُبَايَعَةِ الإِمَامِ الْجَيْشَ عِنْدَ إِرَادَةِ الْقِتَالِ وَبَيَانِ بَيْعَةِ الرِّضْوَانِ تَحْتَ الشَّجَرَةِ
Sahih Muslim 1856 h

It has been narrated (through a different chain of transmitters) on the authority of Salim b. al-Ja'd who said:

I asked Jabir: How many were you on the Day of Hudaibiya? He said: One thousand and four hundred.
وَحَدَّثَنَا عُثْمَانُ بْنُ أَبِي شَيْبَةَ، وَإِسْحَاقُ بْنُ إِبْرَاهِيمَ، قَالَ إِسْحَاقُ أَخْبَرَنَا وَقَالَ، عُثْمَانُ حَدَّثَنَا جَرِيرٌ، عَنِ الأَعْمَشِ، حَدَّثَنِي سَالِمُ بْنُ أَبِي الْجَعْدِ، قَالَ قُلْتُ لِجَابِرٍ كَمْ كُنْتُمْ يَوْمَئِذٍ قَالَ أَلْفًا وَأَرْبَعَمِائَةٍ ‏.‏
Reference : Sahih Muslim 1856h
In-book reference : Book 33, Hadith 111
USC-MSA web (English) reference : Book 20, Hadith 4583
  (deprecated numbering scheme)