law: Code of Criminal Procedure Act, 1973
  461.Irregularities which vitiate proceedings.-
  If any Magistrate, not being empowered by law in this behalf,
  
  does any of the following things, namely:-
  (a) attaches and sells property under section 83;
  (b) issues a search-warrant for a document, parcel or other
  
  thing in the custody of a postal or telegraph authority;
  (c) demands security to keep the peace;
  (d) demands security for good behavior;
  (e) discharges a person lawfully bound to be of good behavior;
  (f) cancels a bond to keep the peace;
  (g) makes an order for maintenance;
  (h) makes an order under section 133 as to a local nuisance;
  (i) prohibits, under section 143, the repetition or continuance
  
  of a public nuisance;
  (j) makes an order under Part C or Part D of Chapter X;
  (k) takes cognizance of an offence under clause (c) of
  
  sub-section (1) of section 190;
  (l) tries an offender;
  (m) tries an offender summarily;
  (n) passes a sentence, under section 325, on proceedings
  
  recorded by another Magistrate;
  (o) decides an appeal;
  (p) calls, under section 397, for proceedings; or
  (q) revises an order passed under section 446, his proceedings
  
  shall be void.