Gun dealers are generally prohibited from selling pistols (and usually long guns) to somebody from out of state and this article referenced the gun dealer he bought it from. A person may possibly buy a a firearm from out of state but the firearm can only be shipped state-to-state through a registered gun dealer in the state of his residence, which requires all local laws are followed.
New York has very strict handgun laws and you cannot even own, much less buy a handgun in New York without a permit (unless you are a criminal, and then they are very easy to get). My guess is he bought this handgun in North Carolina from a dealer and did so legally as a resident at the time, probably stationed at Pope AFB as the article refers to him being an AF veteran.
To own and carry a pistol in New York, he would need a very extensive, expensive and lo-o-oong permitting process. My bet is, he didn't go through this almost impossible process but owned and carried it "illegally". However, it is possible he was carrying legally, as he was a "politican", and these special people are more easily able to get the required owning/carrying permit, unlike the ordinary serfs of New York.
The fact the media reports are silent on the details indicates to me something funny went on. He probably used some political connections to get a permit, otherwise the papers would be screaming about the "illegal" gun which found it's nefarious way into NY from North Carolina - a "loophole" that just has to be plugged by another law!
Yeah, these guns just get up on their own little metal legs and run right to New York City on their own. They also tend to load themselves and manage to pull their own triggers without the aid of a human. (/sarcasm)
FMCDH