If they have the evidence/probable cause to charge you, then your rights do not need to be read. Only if you were formally arrested and then if they began to question you should your rights have been administered.
At this time, I suggest you will want to have a local attorney or military attorney review the charges. If you did not have any idea the gun was stolen, then it may be possible to have those charges dismissed and, of course, the person who gave you the gun would be charged accordingly.
If you were formally arrested, fingerprinted and charged, and they questioned you for more information to give them evidence and probable cause, then your rights should have been read. This is something your local attorney will need to ascertain for you. If the only evidence they have against you was gained after your arrest and no rights were read, then it is arguable inadmissible. No evidence, no case.
If you have further questions, you may post them here and i will continue to assist. Otherwise, even if you have a subscription with JA please remember to ACCEPT my answer as that is the only way I can get credit for my time and information in this matter. Thank you and Good luck