GDPR explicitly permits data to be accessed for legal purposes. I'm sure most judges would be well aware that their warrants shouldn't be overly broad but there is also a trust in legal officers to be discreet enough not to disclose anything they might have accidentally seen.