Is it safe to have a wall wart plugged in to a receptacle in an attic?
Use POE (Power over Ethernet), check to see if the router supports it directly, otherwise get a power injector and pickup (Cisco Linksys for example, has them available to power their wireless/router or WAP products).

This was the easiest to use a wireless bridge between two buildings where the antenna would be located 50' from the computers that needed the link and the inside Ethernet switch respectively.

This keeps the 120VAC wallwart out of the attic and exposure to excess heat and converts the power transmission requirements to low voltage over the CAT-X Ethernet cable.