Section 77 of The Indian Penal Code, 1860 View Chapter 4

Act of Judge when acting judicially

Nothing is an offence which is done by a Judge when acting judicially in the exercise of any power which is, or which in good faith he believes to be, given to him by law.