The Massachusetts Appeals Court ruled Tuesday that Boston police officers did nothing wrong when they searched a man walking through Dorchester's Clam Point early one morning right after a nearby gas station had been robbed at gunpoint, so prosecutors can use the gun the officers found in his backpack as evidence against him.