I have some advice. I've bought items of dubious pedigree, some military items, and what I did was run the SN through the mfg., MPI, MP, CID, NCIS, FBI, local police and sheriff. They were all glad to run the SN for me to check if it was stolen, missing or wanted. After it checked out, I'd go ahead with the purchase. Once I met a guy on post to make a purchase and a range worker called the MP's when he saw us with NODs and other gear. They ran the numbers on everything and said have a good day.
The only other concern I'd have, it being a firearm, is whether or not it was used in a crime. You have no idea of the circumstances in which that pistol was hidden. The only way to tell would be ballistics. What if you used it in a legitimate SD situation, but the ballistics came back consistent with use in some crime as well? How do you rule that out? To be tested it'd have to be sent to a lab. Or does this matter given the situation?
I'd check it out the best you can, maybe "register" or record a transfer to yourself with today's date provided it's not stolen. Keep records of how it was obtained, best you can. If you know of someone or a way to get the ballistics tested against known crime weapons, that'd be nice IMO. But this may be easier said than done.
Last but certainly not least, I also think a call to an NFA lawyer (one versed well in firearms laws) would be a good idea too, they may have better info none of us are even considering. Plus it's a good way to CYA. Just be safe with your new find.