Backorders are disabled in system > configuration > catalog > inventory but a customer bought a product with quantity 0, so after he purchased it, product's quantity became -1. How is it possible? I want that the customers can't buy a product with quantity 0.
You need to check below setting
In particular product setting -> Inventory -> Backorders set to "No Backorders".
System-> Configuration -> Catalog -> Inventory -> Product Stock Options -> Qty for Item's Status to Become Out of Stock set to "0".
Refer below Inventory settings.
May be helpful to you.