I’m not a lawyer. But in a case at the fourth circuit, it was ruled that the police can search anyone with a gun, lawful or otherwise:
In sum, individuals who carry firearms lawfully or unlawfully pose a risk of danger to themselves, law enforcement officers, and the public at large. Accordingly, law enforcement officers may frisk lawfully stopped individuals whom the officers reasonably suspect are carrying a firearm because a detainees possession of a firearm poses a categorical danger to the officers.
…
I see no basis nor does the majority opinion provide any for limiting our conclusion that individuals who choose to carry firearms are categorically dangerous to the Terry frisk inquiry. Accordingly, the majority decision today necessarily leads to the conclusion that individuals who elect to carry firearms forego other constitutional rights, like the Fourth Amendment right to have law enforcement officers knock-and-announce before forcibly entering homes. . . . Likewise, it is difficult to escape the conclusion that individuals who choose to carry firearms necessarily face greater restriction on their concurrent exercise of other constitutional rights, like those protected by the First Amendment.
So, if the police are coming to your house to investigate something and find that you have a gun permit, they can bust in your door, toss in some flashbangs, and get their ninja on. This is dangerous.